- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.helix.store.zk.ZkHelixPropertyStore.<init>()
方法的一些代码示例,展示了ZkHelixPropertyStore.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkHelixPropertyStore.<init>()
方法的具体详情如下:
包路径:org.apache.helix.store.zk.ZkHelixPropertyStore
类名称:ZkHelixPropertyStore
方法名:<init>
暂无
代码示例来源:origin: apache/incubator-gobblin
/**
* State store that stores instances of {@link State}s in a ZooKeeper-backed {@link HelixPropertyStore}
* storeRootDir will be created when the first entry is written if it does not exist
* @param connectString ZooKeeper connect string
* @param storeRootDir The root directory for the state store
* @param compressedValues should values be compressed for storage?
* @param stateClass The type of state being stored
* @throws IOException
*/
public ZkStateStore(String connectString, String storeRootDir, boolean compressedValues, Class<T> stateClass)
throws IOException {
this.compressedValues = compressedValues;
this.stateClass = stateClass;
ZkSerializer serializer = new ByteArraySerializer();
propStore = new ZkHelixPropertyStore<byte[]>(connectString, serializer, storeRootDir);
}
代码示例来源:origin: apache/incubator-pinot
public AutoAddInvertedIndex(@Nonnull String zkAddress, @Nonnull String clusterName, @Nonnull String controllerAddress,
@Nonnull String brokerAddress, @Nonnull Strategy strategy, @Nonnull Mode mode) {
_clusterName = clusterName;
_controllerAddress = controllerAddress;
_brokerAddress = brokerAddress;
_helixAdmin = new ZKHelixAdmin(zkAddress);
_propertyStore = new ZkHelixPropertyStore<>(zkAddress, new ZNRecordSerializer(),
PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName));
_strategy = strategy;
_mode = mode;
}
代码示例来源:origin: apache/incubator-pinot
private void init() {
LOGGER.info("Trying to connect to " + _zkAddress + " cluster " + _clusterName);
_helixAdmin = new ZKHelixAdmin(_zkAddress);
ZNRecordSerializer serializer = new ZNRecordSerializer();
String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, _clusterName);
_propertyStore = new ZkHelixPropertyStore<>(_zkAddress, serializer, path);
}
代码示例来源:origin: apache/incubator-pinot
public TableRetentionValidator(@Nonnull String zkAddress, @Nonnull String clusterName) {
_clusterName = clusterName;
_helixAdmin = new ZKHelixAdmin(zkAddress);
_propertyStore = new ZkHelixPropertyStore<>(zkAddress, new ZNRecordSerializer(),
PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName));
}
代码示例来源:origin: apache/incubator-pinot
@Override
public boolean execute()
throws Exception {
if (!_validateTableConfig && !_validateSchema) {
throw new RuntimeException("Need to specify at least one of -schema and -tableConfig");
}
LOGGER.info("Connecting to Zookeeper: {}, cluster: ", _zkAddress, _clusterName);
ZNRecordSerializer serializer = new ZNRecordSerializer();
String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, _clusterName);
_helixPropertyStore = new ZkHelixPropertyStore<>(_zkAddress, serializer, path);
LOGGER.info("\n\n-------------------- Starting Validation --------------------");
if (_validateTableConfig) {
validateTableConfig();
}
if (_validateSchema) {
validateSchema();
}
return true;
}
代码示例来源:origin: apache/incubator-pinot
private TableConfig getTableConfig(String tableName)
throws IOException {
ZNRecordSerializer serializer = new ZNRecordSerializer();
String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, zkPath);
ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<>(zkHost, serializer, path);
ZNRecord tcZnRecord = propertyStore.get("/CONFIGS/TABLE/" + tableName, null, 0);
TableConfig tableConfig = TableConfig.fromZnRecord(tcZnRecord);
LOGGER.debug("Loaded table config");
return tableConfig;
}
代码示例来源:origin: apache/incubator-pinot
public PinotZKChanger(String zkAddress, String clusterName) {
this.clusterName = clusterName;
helixAdmin = new ZKHelixAdmin(zkAddress);
helixManager = HelixManagerFactory
.getZKHelixManager(clusterName, "PinotNumReplicaChanger", InstanceType.ADMINISTRATOR, zkAddress);
try {
helixManager.connect();
} catch (Exception e) {
throw new RuntimeException(e);
}
ZNRecordSerializer serializer = new ZNRecordSerializer();
String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
propertyStore = new ZkHelixPropertyStore<>(zkAddress, serializer, path);
}
代码示例来源:origin: apache/incubator-pinot
void setPropertyStore(String clusterName) {
_propertyStore =
new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkclient), "/" + clusterName + "/PROPERTYSTORE",
null);
}
代码示例来源:origin: apache/incubator-pinot
private static void initPropertyStorePath(String helixClusterName, String zkPath) {
String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, helixClusterName);
ZkHelixPropertyStore<ZNRecord> propertyStore =
new ZkHelixPropertyStore<ZNRecord>(zkPath, new ZNRecordSerializer(), propertyStorePath);
propertyStore.create("/CONFIGS", new ZNRecord(""), AccessOption.PERSISTENT);
propertyStore.create("/CONFIGS/CLUSTER", new ZNRecord(""), AccessOption.PERSISTENT);
propertyStore.create("/CONFIGS/TABLE", new ZNRecord(""), AccessOption.PERSISTENT);
propertyStore.create("/CONFIGS/INSTANCE", new ZNRecord(""), AccessOption.PERSISTENT);
propertyStore.create("/SCHEMAS", new ZNRecord(""), AccessOption.PERSISTENT);
propertyStore.create("/SEGMENTS", new ZNRecord(""), AccessOption.PERSISTENT);
}
代码示例来源:origin: apache/incubator-pinot
@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);
}
代码示例来源:origin: uber/chaperone
public static ZkHelixPropertyStore<ZNRecord> getZkPropertyStore(HelixManager helixManager,
String clusterName) {
ZkBaseDataAccessor<ZNRecord> baseAccessor =
(ZkBaseDataAccessor<ZNRecord>) helixManager.getHelixDataAccessor().getBaseDataAccessor();
String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
propertyStorePath, Arrays.asList(propertyStorePath));
return propertyStore;
}
代码示例来源:origin: org.apache.helix/helix-core
public AutoFallbackPropertyStore(ZkBaseDataAccessor<T> accessor, String root, String fallbackRoot) {
super(accessor, root, null);
if (accessor.exists(fallbackRoot, 0)) {
_fallbackStore = new ZkHelixPropertyStore<T>(accessor, fallbackRoot, null);
} else {
LOG.info("fallbackRoot: " + fallbackRoot
+ " doesn't exist, skip creating fallback property store");
_fallbackStore = null;
}
}
代码示例来源:origin: apache/helix
public AutoFallbackPropertyStore(ZkBaseDataAccessor<T> accessor, String root, String fallbackRoot) {
super(accessor, root, null);
if (accessor.exists(fallbackRoot, 0)) {
_fallbackStore = new ZkHelixPropertyStore<T>(accessor, fallbackRoot, null);
} else {
LOG.info("fallbackRoot: " + fallbackRoot
+ " doesn't exist, skip creating fallback property store");
_fallbackStore = null;
}
}
代码示例来源:origin: uber/uReplicator
public static ZkHelixPropertyStore<ZNRecord> getZkPropertyStore(HelixManager helixManager,
String clusterName) {
ZkBaseDataAccessor<ZNRecord> baseAccessor =
(ZkBaseDataAccessor<ZNRecord>) helixManager.getHelixDataAccessor().getBaseDataAccessor();
String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
propertyStorePath, Arrays.asList(propertyStorePath));
return propertyStore;
}
代码示例来源:origin: uber/uReplicator
public static ZkHelixPropertyStore<ZNRecord> getZkPropertyStore(HelixManager helixManager,
String clusterName) {
ZkBaseDataAccessor<ZNRecord> baseAccessor =
(ZkBaseDataAccessor<ZNRecord>) helixManager.getHelixDataAccessor().getBaseDataAccessor();
String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
propertyStorePath, Arrays.asList(propertyStorePath));
return propertyStore;
}
代码示例来源:origin: apache/helix
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);
}
代码示例来源:origin: org.apache.helix/helix-core
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);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* @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);
}
代码示例来源:origin: apache/helix
/**
* @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);
}
代码示例来源:origin: apache/helix
/**
* @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);
}
我想了解 Ruby 方法 methods() 是如何工作的。 我尝试使用“ruby 方法”在 Google 上搜索,但这不是我需要的。 我也看过 ruby-doc.org,但我没有找到这种方法。
Test 方法 对指定的字符串执行一个正则表达式搜索,并返回一个 Boolean 值指示是否找到匹配的模式。 object.Test(string) 参数 object 必选项。总是一个
Replace 方法 替换在正则表达式查找中找到的文本。 object.Replace(string1, string2) 参数 object 必选项。总是一个 RegExp 对象的名称。
Raise 方法 生成运行时错误 object.Raise(number, source, description, helpfile, helpcontext) 参数 object 应为
Execute 方法 对指定的字符串执行正则表达式搜索。 object.Execute(string) 参数 object 必选项。总是一个 RegExp 对象的名称。 string
Clear 方法 清除 Err 对象的所有属性设置。 object.Clear object 应为 Err 对象的名称。 说明 在错误处理后,使用 Clear 显式地清除 Err 对象。此
CopyFile 方法 将一个或多个文件从某位置复制到另一位置。 object.CopyFile source, destination[, overwrite] 参数 object 必选
Copy 方法 将指定的文件或文件夹从某位置复制到另一位置。 object.Copy destination[, overwrite] 参数 object 必选项。应为 File 或 F
Close 方法 关闭打开的 TextStream 文件。 object.Close object 应为 TextStream 对象的名称。 说明 下面例子举例说明如何使用 Close 方
BuildPath 方法 向现有路径后添加名称。 object.BuildPath(path, name) 参数 object 必选项。应为 FileSystemObject 对象的名称
GetFolder 方法 返回与指定的路径中某文件夹相应的 Folder 对象。 object.GetFolder(folderspec) 参数 object 必选项。应为 FileSy
GetFileName 方法 返回指定路径(不是指定驱动器路径部分)的最后一个文件或文件夹。 object.GetFileName(pathspec) 参数 object 必选项。应为
GetFile 方法 返回与指定路径中某文件相应的 File 对象。 object.GetFile(filespec) 参数 object 必选项。应为 FileSystemObject
GetExtensionName 方法 返回字符串,该字符串包含路径最后一个组成部分的扩展名。 object.GetExtensionName(path) 参数 object 必选项。应
GetDriveName 方法 返回包含指定路径中驱动器名的字符串。 object.GetDriveName(path) 参数 object 必选项。应为 FileSystemObjec
GetDrive 方法 返回与指定的路径中驱动器相对应的 Drive 对象。 object.GetDrive drivespec 参数 object 必选项。应为 FileSystemO
GetBaseName 方法 返回字符串,其中包含文件的基本名 (不带扩展名), 或者提供的路径说明中的文件夹。 object.GetBaseName(path) 参数 object 必
GetAbsolutePathName 方法 从提供的指定路径中返回完整且含义明确的路径。 object.GetAbsolutePathName(pathspec) 参数 object
FolderExists 方法 如果指定的文件夹存在,则返回 True;否则返回 False。 object.FolderExists(folderspec) 参数 object 必选项
FileExists 方法 如果指定的文件存在返回 True;否则返回 False。 object.FileExists(filespec) 参数 object 必选项。应为 FileS
我是一名优秀的程序员,十分优秀!