本文整理汇总了Java中org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository类的典型用法代码示例。如果您正苦于以下问题:Java BlobStoreIndexShardRepository类的具体用法?Java BlobStoreIndexShardRepository怎么用?Java BlobStoreIndexShardRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlobStoreIndexShardRepository类属于org.elasticsearch.index.snapshots.blobstore包,在下文中一共展示了BlobStoreIndexShardRepository类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onModule
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void onModule(RepositoriesModule repositoriesModule) {
if (System.getSecurityManager() != null) {
Loggers.getLogger(HdfsPlugin.class).warn("The Java Security Manager is enabled however Hadoop is not compatible with it and thus needs to be disabled; see the docs for more information...");
}
String baseLib = detectLibFolder();
List<URL> cp = getHadoopClassLoaderPath(baseLib);
ClassLoader hadoopCL = URLClassLoader.newInstance(cp.toArray(new URL[cp.size()]), getClass().getClassLoader());
Class<? extends Repository> repository = null;
try {
repository = (Class<? extends Repository>) hadoopCL.loadClass("org.elasticsearch.repositories.hdfs.HdfsRepository");
} catch (ClassNotFoundException cnfe) {
throw new IllegalStateException("Cannot load plugin class; is the plugin class setup correctly?", cnfe);
}
repositoriesModule.registerRepository("hdfs", repository, BlobStoreIndexShardRepository.class);
Loggers.getLogger(HdfsPlugin.class).info("Loaded Hadoop [{}] libraries from {}", getHadoopVersion(hadoopCL), baseLib);
}
示例2: setUp
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
@Before
public void setUp(){
indexShardRepository = mock(BlobStoreIndexShardRepository.class);
cloudFilesService = mock(CloudFilesService.class);
RegionScopedBlobStoreContext blobStoreContext = mock(RegionScopedBlobStoreContext.class);
BlobStore blobStore = mock(BlobStore.class);
Set<Location> locations = new HashSet<Location>();
Set<String> isoCodes = new HashSet<String>();
isoCodes.add("US-IL");
locations.add(new LocationBuilder().id("ORD").description("ORD").scope(LocationScope.REGION).iso3166Codes(isoCodes).build());
when(blobStore.listAssignableLocations()).thenReturn((Set) locations);
when(blobStoreContext.getBlobStore(anyString())).thenReturn(blobStore);
when(cloudFilesService.context()).thenReturn(blobStoreContext);
}
示例3: BlobStoreRepository
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
/**
* Constructs new BlobStoreRepository
*
* @param repositoryName repository name
* @param repositorySettings repository settings
* @param indexShardRepository an instance of IndexShardRepository
*/
protected BlobStoreRepository(String repositoryName, RepositorySettings repositorySettings, IndexShardRepository indexShardRepository) {
super(repositorySettings.globalSettings());
this.repositoryName = repositoryName;
this.indexShardRepository = (BlobStoreIndexShardRepository) indexShardRepository;
snapshotRateLimiter = getRateLimiter(repositorySettings, "max_snapshot_bytes_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB));
restoreRateLimiter = getRateLimiter(repositorySettings, "max_restore_bytes_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB));
readOnly = repositorySettings.settings().getAsBoolean("readonly", false);
}
示例4: configure
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
/**
* Do the binding.
*/
@Override
protected void configure() {
bind(Repository.class).to(SwiftRepository.class).asEagerSingleton();
bind(IndexShardRepository.class).to(BlobStoreIndexShardRepository.class).asEagerSingleton();
bind(SwiftService.class).asEagerSingleton();
}
示例5: configure
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void configure() {
bind(Repository.class).to(SshRepository.class).asEagerSingleton();
bind(IndexShardRepository.class)
.to(BlobStoreIndexShardRepository.class).asEagerSingleton();
}
示例6: RepositoriesModule
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
public RepositoriesModule() {
registerRepository(FsRepository.TYPE, FsRepository.class, BlobStoreIndexShardRepository.class);
registerRepository(URLRepository.TYPE, URLRepository.class, BlobStoreIndexShardRepository.class);
}
示例7: configure
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
@Override
protected void configure() {
bind(Repository.class).to(CloudFilesRepository.class).asEagerSingleton();
bind(IndexShardRepository.class).to(BlobStoreIndexShardRepository.class).asEagerSingleton();
}
示例8: configure
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
@Override
protected void configure() {
bind(Repository.class).to(GridFsRepository.class).asEagerSingleton();
bind(IndexShardRepository.class).to(BlobStoreIndexShardRepository.class).asEagerSingleton();
}
示例9: onModule
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
/**
* Load our repository module into the list, if enabled
* @param repositoriesModule The repositories module to register ourselves with
*/
public void onModule(RepositoriesModule repositoriesModule) {
if (settings.getAsBoolean("swift.repository.enabled", true)) {
repositoriesModule.registerRepository(SwiftRepository.TYPE, SwiftRepository.class, BlobStoreIndexShardRepository.class);
}
}
示例10: onModule
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
public void onModule(RepositoriesModule repositoriesModule) {
Loggers.getLogger(RepositorySshPlugin.class).info("trying to register repository-ssh...");
repositoriesModule.registerRepository(SshRepository.TYPE, SshRepository.class,
BlobStoreIndexShardRepository.class);
}
示例11: configure
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; //导入依赖的package包/类
@Override
protected void configure() {
bind(WebdavService.class).to(getWebdavServiceClass()).asEagerSingleton();
bind(Repository.class).to(WebdavRepository.class).asEagerSingleton();
bind(IndexShardRepository.class).to(BlobStoreIndexShardRepository.class).asEagerSingleton();
}