public static String getAbsoluteZkPathForHelix(String zkBaseUrl) { zkBaseUrl = StringUtils.chomp(zkBaseUrl, "/"); return zkBaseUrl; } }
public String forSegmentDownload(String tableName, String segmentName) throws IOException { return StringUtil .join("/", StringUtils.chomp(_baseUrl, "/"), "segments", tableName, URLEncoder.encode(segmentName, "UTF-8")); }
public String forSegmentDeleteAPI(String tableName, String segmentName, String tableType) throws Exception { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "segments", tableName, URLEncoder.encode(segmentName, "UTF-8") + "?type=" + tableType); }
public String forDeleteSegmentWithGetAPI(String tableName, String segmentName, String tableType) throws Exception { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "segments", URLEncoder.encode(segmentName, "UTF-8") + "?state=drop&" + "type=" + tableType); }
public String forSegmentListAPI(String tableName) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "segments", tableName); } }
public String forTableRebalance(String tableName, String tableType) { String query = "rebalance?dryrun=false&type=" + tableType; return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, query); }
public String forTableReload(String tableName, String tableType) { String query = "reload?type=" + tableType; return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "segments", query); }
public String forDeleteAllSegmentsWithTypeWithGetAPI(String tableName, String tableType) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "segments" + "?state=drop&" + "type=" + tableType); }
public String forListAllSegments(String tableName) throws Exception { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "segments"); }
public String forListAllCrcInformationForTable(String tableName) throws Exception { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "segments", "crc"); }
public String forSegmentDeleteAllAPI(String tableName, String tableType) throws Exception { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "segments", tableName + "?type=" + tableType); }
public String forDeleteTableWithType(String tableName, String tableType) throws Exception { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName + "?type=" + tableType); }
public String forInstanceState(String instanceName) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "instances", instanceName, "state"); }
public String forUpdateTableConfig(String tableName) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName); }
public String forSegmentDelete(String resourceName, String segmentName) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "datafiles", resourceName, segmentName); }
public String forSegmentListAPIWithTableType(String tableName, String tableType) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "segments", tableName + "?type=" + tableType); }
public String forTableView(String tableName, String view, @Nullable String tableType) { String url = StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, view); if (tableType != null) { url += "?tableType=" + tableType; } return url; }
@Override public void onNext(BuildResponseItem item) { super.onNext(item); if (item.isErrorIndicated()) { logger.error(item.getErrorDetail().getMessage()); } else { logger.debug(StringUtils.chomp(item.getStream(), "\n")); } } };
FakeHelixManager(String clusterName, String instanceName, InstanceType instanceType, String zkAddress) { super(clusterName, instanceName, instanceType, zkAddress); super._zkclient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")), ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer()); _zkclient.deleteRecursive("/" + clusterName + "/PROPERTYSTORE"); _zkclient.createPersistent("/" + clusterName + "/PROPERTYSTORE", true); setPropertyStore(clusterName); }
@BeforeTest public void beforeTest() { _zookeeperInstance = ZkStarter.startLocalZkServer(); _zkClient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")), ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer()); String helixClusterName = "TestTimeBoundaryService"; _zkClient.deleteRecursive("/" + helixClusterName + "/PROPERTYSTORE"); _zkClient.createPersistent("/" + helixClusterName + "/PROPERTYSTORE", true); _propertyStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkClient), "/" + helixClusterName + "/PROPERTYSTORE", null); }