提交 34f6bb9d 编写于 作者: A ascrutae

Merge remote-tracking branch 'origin/master'

......@@ -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.RegistryCenter;
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.ConfigInitializer;
import com.a.eye.skywalking.storage.data.file.DataFilesManager;
......@@ -43,7 +43,7 @@ public class Main {
initializeParam();
HealthCollector.init(SERVER_REPORTER_NAME);
new ElasticBooter().boot(NetUtils.getIndexServerPort());
new ElasticBootstrap().boot(NetUtils.getIndexServerPort());
IndexOperatorFactory.initOperatorPool();
DataFilesManager.init();
......
......@@ -9,16 +9,16 @@ import java.io.IOException;
/**
* 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";
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";
private String elasticHome;
public ElasticBooter() {
public ElasticBootstrap() {
this.elasticHome = fetchElasticHome();
}
......
......@@ -5,23 +5,23 @@ import org.junit.Test;
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;
public class ElasticBooterTest {
private String bastPath = ElasticBooterTest.class.getResource("/").getPath() + ".." + File.separator;
public class ElasticBootstrapTest {
private String bastPath = ElasticBootstrapTest.class.getResource("/").getPath() + ".." + File.separator;
@Test
public void fetchElasticHomeWithoutProperty() {
ElasticBooter booter = new ElasticBooter();
ElasticBootstrap booter = new ElasticBootstrap();
assertEquals("Elastic Home :", booter.fetchElasticHome(), bastPath + "install/data/index");
}
@Test
public void fetchElasticHomeWithProperty() {
System.setProperty(DATA_INDEX_HOME, "/test/test");
ElasticBooter fetcher = new ElasticBooter();
ElasticBootstrap fetcher = new ElasticBootstrap();
assertEquals("Elastic Home :", fetcher.fetchElasticHome(), "/test/test");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册