本文整理汇总了Java中org.apache.helix.store.zk.ZkHelixPropertyStore.exists方法的典型用法代码示例。如果您正苦于以下问题:Java ZkHelixPropertyStore.exists方法的具体用法?Java ZkHelixPropertyStore.exists怎么用?Java ZkHelixPropertyStore.exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.helix.store.zk.ZkHelixPropertyStore
的用法示例。
在下文中一共展示了ZkHelixPropertyStore.exists方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOfflineSegmentZKMetadataListForTable
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static List<OfflineSegmentZKMetadata> getOfflineSegmentZKMetadataListForTable(ZkHelixPropertyStore<ZNRecord> propertyStore, String tableName) {
List<OfflineSegmentZKMetadata> resultList = new ArrayList<OfflineSegmentZKMetadata>();
if (propertyStore == null) {
return resultList;
}
String offlineTableName = TableNameBuilder.OFFLINE_TABLE_NAME_BUILDER.forTable(tableName);
if (propertyStore.exists(constructPropertyStorePathForResource(offlineTableName), AccessOption.PERSISTENT)) {
List<ZNRecord> znRecordList = propertyStore.getChildren(constructPropertyStorePathForResource(offlineTableName), null, AccessOption.PERSISTENT);
if (znRecordList != null) {
for (ZNRecord record : znRecordList) {
resultList.add(new OfflineSegmentZKMetadata(record));
}
}
}
return resultList;
}
示例2: getRealtimeSegmentZKMetadataListForTable
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static List<RealtimeSegmentZKMetadata> getRealtimeSegmentZKMetadataListForTable(ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceName) {
List<RealtimeSegmentZKMetadata> resultList = new ArrayList<RealtimeSegmentZKMetadata>();
if (propertyStore == null) {
return resultList;
}
String realtimeTableName = TableNameBuilder.REALTIME_TABLE_NAME_BUILDER.forTable(resourceName);
if (propertyStore.exists(constructPropertyStorePathForResource(realtimeTableName), AccessOption.PERSISTENT)) {
List<ZNRecord> znRecordList = propertyStore.getChildren(constructPropertyStorePathForResource(realtimeTableName), null, AccessOption.PERSISTENT);
if (znRecordList != null) {
for (ZNRecord record : znRecordList) {
resultList.add(new RealtimeSegmentZKMetadata(record));
}
}
}
return resultList;
}
示例3: getOfflineSegmentZKMetadataListForTable
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static List<OfflineSegmentZKMetadata> getOfflineSegmentZKMetadataListForTable(
ZkHelixPropertyStore<ZNRecord> propertyStore, String tableName) {
List<OfflineSegmentZKMetadata> resultList = new ArrayList<>();
if (propertyStore == null) {
return resultList;
}
String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(tableName);
if (propertyStore.exists(constructPropertyStorePathForResource(offlineTableName), AccessOption.PERSISTENT)) {
List<ZNRecord> znRecordList =
propertyStore.getChildren(constructPropertyStorePathForResource(offlineTableName), null,
AccessOption.PERSISTENT);
if (znRecordList != null) {
for (ZNRecord record : znRecordList) {
resultList.add(new OfflineSegmentZKMetadata(record));
}
}
}
return resultList;
}
示例4: getRealtimeSegmentZKMetadataListForTable
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static List<RealtimeSegmentZKMetadata> getRealtimeSegmentZKMetadataListForTable(
ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceName) {
List<RealtimeSegmentZKMetadata> resultList = new ArrayList<>();
if (propertyStore == null) {
return resultList;
}
String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(resourceName);
if (propertyStore.exists(constructPropertyStorePathForResource(realtimeTableName), AccessOption.PERSISTENT)) {
List<ZNRecord> znRecordList =
propertyStore.getChildren(constructPropertyStorePathForResource(realtimeTableName), null,
AccessOption.PERSISTENT);
if (znRecordList != null) {
for (ZNRecord record : znRecordList) {
resultList.add(new RealtimeSegmentZKMetadata(record));
}
}
}
return resultList;
}
示例5: setClusterTenantIsolationEnabled
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static void setClusterTenantIsolationEnabled(ZkHelixPropertyStore<ZNRecord> propertyStore, boolean isSingleTenantCluster) {
if (!propertyStore.exists(constructPropertyStorePathForControllerConfig(CLUSTER_TENANT_ISOLATION_ENABLED_KEY), AccessOption.PERSISTENT)) {
ZNRecord znRecord = new ZNRecord(CLUSTER_TENANT_ISOLATION_ENABLED_KEY);
znRecord.setBooleanField(CLUSTER_TENANT_ISOLATION_ENABLED_KEY, isSingleTenantCluster);
propertyStore.set(constructPropertyStorePathForControllerConfig(CLUSTER_TENANT_ISOLATION_ENABLED_KEY), znRecord, AccessOption.PERSISTENT);
}
}
示例6: getClusterTenantIsolationEnabled
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static Boolean getClusterTenantIsolationEnabled(ZkHelixPropertyStore<ZNRecord> propertyStore) {
String controllerConfigPath = constructPropertyStorePathForControllerConfig(CLUSTER_TENANT_ISOLATION_ENABLED_KEY);
if (propertyStore.exists(controllerConfigPath, AccessOption.PERSISTENT)) {
ZNRecord znRecord = propertyStore.get(controllerConfigPath, null, AccessOption.PERSISTENT);
if (znRecord.getSimpleFields().keySet().contains(CLUSTER_TENANT_ISOLATION_ENABLED_KEY)) {
return znRecord.getBooleanField(CLUSTER_TENANT_ISOLATION_ENABLED_KEY, true);
} else {
return true;
}
} else {
return true;
}
}
示例7: isSegmentExisted
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static boolean isSegmentExisted(ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceNameForResource, String segmentName) {
return propertyStore.exists(constructPropertyStorePathForSegment(resourceNameForResource, segmentName), AccessOption.PERSISTENT);
}
示例8: removeResourceSegmentsFromPropertyStore
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static void removeResourceSegmentsFromPropertyStore(ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceName) {
String propertyStorePath = constructPropertyStorePathForResource(resourceName);
if (propertyStore.exists(propertyStorePath, AccessOption.PERSISTENT)) {
propertyStore.remove(propertyStorePath, AccessOption.PERSISTENT);
}
}
示例9: removeResourceConfigFromPropertyStore
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static void removeResourceConfigFromPropertyStore(ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceName) {
String propertyStorePath = constructPropertyStorePathForResourceConfig(resourceName);
if (propertyStore.exists(propertyStorePath, AccessOption.PERSISTENT)) {
propertyStore.remove(propertyStorePath, AccessOption.PERSISTENT);
}
}
示例10: isSegmentExisted
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static boolean isSegmentExisted(ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceNameForResource, String segmentName) {
return propertyStore.exists(constructPropertyStorePathForSegment(resourceNameForResource, segmentName),
AccessOption.PERSISTENT);
}
示例11: removeKafkaPartitionAssignmentFromPropertyStore
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static void removeKafkaPartitionAssignmentFromPropertyStore(ZkHelixPropertyStore<ZNRecord> propertyStore, String realtimeTableName) {
String propertyStorePath = constructPropertyStorePathForKafkaPartitions(realtimeTableName);
if (propertyStore.exists(propertyStorePath, AccessOption.PERSISTENT)) {
propertyStore.remove(propertyStorePath, AccessOption.PERSISTENT);
}
}
示例12: removeInstancePartitionAssignmentFromPropertyStore
import org.apache.helix.store.zk.ZkHelixPropertyStore; //导入方法依赖的package包/类
public static void removeInstancePartitionAssignmentFromPropertyStore(ZkHelixPropertyStore<ZNRecord> propertyStore, String offlineTableName) {
String propertyStorePath = constructPropertyStorePathForInstancePartitions(offlineTableName);
if (propertyStore.exists(propertyStorePath, AccessOption.PERSISTENT)) {
propertyStore.remove(propertyStorePath, AccessOption.PERSISTENT);
}
}