mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 15:17:30 -04:00
Remove guice injection from IndexStore and friends
This commit replaces dependency injection from IndexStore and subclasses and replaces it with dedicated set of dependencies.
This commit is contained in:
parent
c335b3a176
commit
5ffdf15f02
17 changed files with 136 additions and 181 deletions
|
@ -34,7 +34,6 @@ import java.nio.file.Path;
|
|||
|
||||
public class SmbMmapFsDirectoryService extends FsDirectoryService {
|
||||
|
||||
@Inject
|
||||
public SmbMmapFsDirectoryService(IndexSettings indexSettings, IndexStore indexStore, ShardPath path) {
|
||||
super(indexSettings, indexStore, path);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.index.store.smbmmapfs;
|
||||
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.shard.ShardPath;
|
||||
import org.elasticsearch.index.store.DirectoryService;
|
||||
|
@ -28,7 +27,6 @@ import org.elasticsearch.indices.store.IndicesStore;
|
|||
|
||||
public class SmbMmapFsIndexStore extends IndexStore {
|
||||
|
||||
@Inject
|
||||
public SmbMmapFsIndexStore(IndexSettings indexSettings, IndicesStore indicesStore) {
|
||||
super(indexSettings, indicesStore);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.lucene.store.Directory;
|
|||
import org.apache.lucene.store.LockFactory;
|
||||
import org.apache.lucene.store.SimpleFSDirectory;
|
||||
import org.apache.lucene.store.SmbDirectoryWrapper;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.shard.ShardPath;
|
||||
import org.elasticsearch.index.store.FsDirectoryService;
|
||||
|
@ -34,7 +33,6 @@ import java.nio.file.Path;
|
|||
|
||||
public class SmbSimpleFsDirectoryService extends FsDirectoryService {
|
||||
|
||||
@Inject
|
||||
public SmbSimpleFsDirectoryService(IndexSettings indexSettings, IndexStore indexStore, ShardPath path) {
|
||||
super(indexSettings, indexStore, path);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.index.store.smbsimplefs;
|
||||
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.shard.ShardPath;
|
||||
import org.elasticsearch.index.store.DirectoryService;
|
||||
|
@ -28,7 +27,6 @@ import org.elasticsearch.indices.store.IndicesStore;
|
|||
|
||||
public class SmbSimpleFsIndexStore extends IndexStore {
|
||||
|
||||
@Inject
|
||||
public SmbSimpleFsIndexStore(IndexSettings indexSettings, IndicesStore indicesStore) {
|
||||
super(indexSettings, indicesStore);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.plugin.store.smb;
|
||||
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.store.IndexStoreModule;
|
||||
import org.elasticsearch.index.store.smbmmapfs.SmbMmapFsIndexStore;
|
||||
import org.elasticsearch.index.store.smbsimplefs.SmbSimpleFsIndexStore;
|
||||
|
@ -36,8 +37,8 @@ public class SMBStorePlugin extends Plugin {
|
|||
return "SMB Store Plugin";
|
||||
}
|
||||
|
||||
public void onModule(IndexStoreModule storeModule) {
|
||||
storeModule.addIndexStore("smb_mmap_fs", SmbMmapFsIndexStore.class);
|
||||
storeModule.addIndexStore("smb_simple_fs", SmbSimpleFsIndexStore.class);
|
||||
public void onModule(IndexModule storeModule) {
|
||||
storeModule.addIndexStore("smb_mmap_fs", SmbMmapFsIndexStore::new);
|
||||
storeModule.addIndexStore("smb_simple_fs", SmbSimpleFsIndexStore::new);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue