/** * @param zkAddr * @param clusterName * @param dimensionName Identify of the capacity attribute. For example memory, CPU. * Need to match resource weight dimension. */ public ZkBasedPartitionWeightProvider(String zkAddr, String clusterName, String dimensionName) { this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(), PropertyPathBuilder.propertyStore(clusterName)), dimensionName); }
public TaskDriver(ZkClient client, ZkBaseDataAccessor<ZNRecord> baseAccessor, String clusterName) { this(new ZKHelixAdmin(client), new ZKHelixDataAccessor(clusterName, baseAccessor), new ZkHelixPropertyStore<ZNRecord>(baseAccessor, PropertyPathBuilder.propertyStore(clusterName), null), clusterName); }
/** * @param zkAddr * @param clusterName * @param dimensionName Identify of the capacity attribute. For example memory, CPU. * Need to match resource weight dimension. */ public ZkBasedPartitionWeightProvider(String zkAddr, String clusterName, String dimensionName) { this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(), PropertyPathBuilder.propertyStore(clusterName)), dimensionName); }
@Override public synchronized ZkHelixPropertyStore<ZNRecord> getHelixPropertyStore() { checkConnected(_waitForConnectedTimeout); if (_helixPropertyStore == null) { String path = PropertyPathBuilder.propertyStore(_clusterName); String fallbackPath = String.format("/%s/%s", _clusterName, "HELIX_PROPERTYSTORE"); _helixPropertyStore = new AutoFallbackPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkclient), path, fallbackPath); } return _helixPropertyStore; }
@Override public synchronized ZkHelixPropertyStore<ZNRecord> getHelixPropertyStore() { checkConnected(_waitForConnectedTimeout); if (_helixPropertyStore == null) { String path = PropertyPathBuilder.propertyStore(_clusterName); String fallbackPath = String.format("/%s/%s", _clusterName, "HELIX_PROPERTYSTORE"); _helixPropertyStore = new AutoFallbackPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkclient), path, fallbackPath); } return _helixPropertyStore; }
/** * @param zkAddr * @param clusterName * @param dimensionName Identify of the capacity attribute. For example memory, CPU. * Need to match resource weight dimension. */ public ZkBasedCapacityProvider(String zkAddr, String clusterName, String dimensionName) { this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(), PropertyPathBuilder.propertyStore(clusterName)), dimensionName); }
public TaskDriver(HelixZkClient client, ZkBaseDataAccessor<ZNRecord> baseAccessor, String clusterName) { this(new ZKHelixAdmin(client), new ZKHelixDataAccessor(clusterName, baseAccessor), new ZkHelixPropertyStore<>(baseAccessor, PropertyPathBuilder.propertyStore(clusterName), null), clusterName); }
/** * @param zkAddr * @param clusterName * @param dimensionName Identify of the capacity attribute. For example memory, CPU. * Need to match resource weight dimension. */ public ZkBasedCapacityProvider(String zkAddr, String clusterName, String dimensionName) { this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(), PropertyPathBuilder.propertyStore(clusterName)), dimensionName); }
requiredPaths.add(PropertyPathBuilder.instanceConfig(clusterName)); requiredPaths.add(PropertyPathBuilder.resourceConfig(clusterName)); requiredPaths.add(PropertyPathBuilder.propertyStore(clusterName)); requiredPaths.add(PropertyPathBuilder.liveInstance(clusterName)); requiredPaths.add(PropertyPathBuilder.instance(clusterName));
requiredPaths.add(PropertyPathBuilder.instanceConfig(clusterName)); requiredPaths.add(PropertyPathBuilder.resourceConfig(clusterName)); requiredPaths.add(PropertyPathBuilder.propertyStore(clusterName)); requiredPaths.add(PropertyPathBuilder.liveInstance(clusterName)); requiredPaths.add(PropertyPathBuilder.instance(clusterName));
@Override public boolean verify() throws Exception { HelixDataAccessor accessor = _manager.getHelixDataAccessor(); PropertyKey.Builder keyBuilder = accessor.keyBuilder(); // check paths for resource-config, ideal-state, external-view, property-store List<String> paths = Lists.newArrayList(keyBuilder.resourceConfigs().getPath(), keyBuilder.idealStates().getPath(), keyBuilder.externalViews().getPath(), PropertyPathBuilder.propertyStore(CLUSTER_NAME) + TaskConstants.REBALANCER_CONTEXT_ROOT); for (String path : paths) { List<String> childNames = accessor.getBaseDataAccessor().getChildNames(path, 0); for (String childName : childNames) { if (childName.startsWith(queueName)) { return false; } } } return true; } }, 30 * 1000);
_zkClient.createPersistent(path); path = PropertyPathBuilder.propertyStore(clusterName); _zkClient.createPersistent(path);
_zkClient.createPersistent(path); path = PropertyPathBuilder.propertyStore(clusterName); _zkClient.createPersistent(path);
_baseDataAccessor.create(path, new ZNRecord(clusterName), 0); path = PropertyPathBuilder.propertyStore(clusterName); _baseDataAccessor.create(path, new ZNRecord(clusterName), 0);