提交 ba72fcc4 编写于 作者: wu-sheng's avatar wu-sheng

remove some useless code

上级 4ebacf09
...@@ -9,7 +9,7 @@ import com.a.eye.skywalking.registry.RegistryCenterFactory; ...@@ -9,7 +9,7 @@ import com.a.eye.skywalking.registry.RegistryCenterFactory;
import com.a.eye.skywalking.registry.api.CenterType; import com.a.eye.skywalking.registry.api.CenterType;
import com.a.eye.skywalking.registry.api.RegistryCenter; import com.a.eye.skywalking.registry.api.RegistryCenter;
import com.a.eye.skywalking.registry.impl.zookeeper.ZookeeperConfig; import com.a.eye.skywalking.registry.impl.zookeeper.ZookeeperConfig;
import com.a.eye.skywalking.storage.boot.ElasticBooter; import com.a.eye.skywalking.storage.boot.ElasticBootstrap;
import com.a.eye.skywalking.storage.config.Config; import com.a.eye.skywalking.storage.config.Config;
import com.a.eye.skywalking.storage.config.ConfigInitializer; import com.a.eye.skywalking.storage.config.ConfigInitializer;
import com.a.eye.skywalking.storage.data.file.DataFilesManager; import com.a.eye.skywalking.storage.data.file.DataFilesManager;
...@@ -43,7 +43,7 @@ public class Main { ...@@ -43,7 +43,7 @@ public class Main {
initializeParam(); initializeParam();
HealthCollector.init(SERVER_REPORTER_NAME); HealthCollector.init(SERVER_REPORTER_NAME);
new ElasticBooter().boot(NetUtils.getIndexServerPort()); new ElasticBootstrap().boot(NetUtils.getIndexServerPort());
IndexOperatorFactory.initOperatorPool(); IndexOperatorFactory.initOperatorPool();
DataFilesManager.init(); DataFilesManager.init();
......
...@@ -9,16 +9,16 @@ import java.io.IOException; ...@@ -9,16 +9,16 @@ import java.io.IOException;
/** /**
* Created by xin on 2016/11/20. * Created by xin on 2016/11/20.
*/ */
public class ElasticBooter { public class ElasticBootstrap {
private static ILog logger = LogManager.getLogger(ElasticBooter.class); private static ILog logger = LogManager.getLogger(ElasticBootstrap.class);
public static final String DATA_INDEX_HOME = "DATA_INDEX_HOME"; public static final String DATA_INDEX_HOME = "DATA_INDEX_HOME";
private static final String DEVELOP_RUNTIME_ELASTIC_HOME = private static final String DEVELOP_RUNTIME_ELASTIC_HOME =
ElasticBooter.class.getResource("/").getPath() + ".." + File.separator + "install" + File.separator + "data" ElasticBootstrap.class.getResource("/").getPath() + ".." + File.separator + "install" + File.separator + "data"
+ File.separator + "index"; + File.separator + "index";
private String elasticHome; private String elasticHome;
public ElasticBooter() { public ElasticBootstrap() {
this.elasticHome = fetchElasticHome(); this.elasticHome = fetchElasticHome();
} }
......
...@@ -5,23 +5,23 @@ import org.junit.Test; ...@@ -5,23 +5,23 @@ import org.junit.Test;
import java.io.File; import java.io.File;
import static com.a.eye.skywalking.storage.boot.ElasticBooter.DATA_INDEX_HOME; import static com.a.eye.skywalking.storage.boot.ElasticBootstrap.DATA_INDEX_HOME;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
public class ElasticBooterTest { public class ElasticBootstrapTest {
private String bastPath = ElasticBooterTest.class.getResource("/").getPath() + ".." + File.separator; private String bastPath = ElasticBootstrapTest.class.getResource("/").getPath() + ".." + File.separator;
@Test @Test
public void fetchElasticHomeWithoutProperty() { public void fetchElasticHomeWithoutProperty() {
ElasticBooter booter = new ElasticBooter(); ElasticBootstrap booter = new ElasticBootstrap();
assertEquals("Elastic Home :", booter.fetchElasticHome(), bastPath + "install/data/index"); assertEquals("Elastic Home :", booter.fetchElasticHome(), bastPath + "install/data/index");
} }
@Test @Test
public void fetchElasticHomeWithProperty() { public void fetchElasticHomeWithProperty() {
System.setProperty(DATA_INDEX_HOME, "/test/test"); System.setProperty(DATA_INDEX_HOME, "/test/test");
ElasticBooter fetcher = new ElasticBooter(); ElasticBootstrap fetcher = new ElasticBootstrap();
assertEquals("Elastic Home :", fetcher.fetchElasticHome(), "/test/test"); assertEquals("Elastic Home :", fetcher.fetchElasticHome(), "/test/test");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册