- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.helix.manager.zk.ZkBaseDataAccessor.<init>()
方法的一些代码示例,展示了ZkBaseDataAccessor.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkBaseDataAccessor.<init>()
方法的具体详情如下:
包路径:org.apache.helix.manager.zk.ZkBaseDataAccessor
类名称:ZkBaseDataAccessor
方法名:<init>
暂无
代码示例来源:origin: apache/incubator-pinot
void setPropertyStore(String clusterName) {
_propertyStore =
new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkclient), "/" + clusterName + "/PROPERTYSTORE",
null);
}
代码示例来源:origin: apache/incubator-pinot
zkClient.setZkSerializer(new ZNRecordSerializer());
HelixDataAccessor accessor =
new ZKHelixDataAccessor(helixClusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
PropertyKey.Builder keyBuilder = accessor.keyBuilder();
accessor.setProperty(keyBuilder.stateModelDef(segmentStateModelName), newStateModelDef);
代码示例来源:origin: apache/incubator-pinot
LOGGER.info("Connecting to Zookeeper at: {}", _zkAddress);
zkClient.waitUntilConnected(CommonConstants.Helix.ZkClient.DEFAULT_CONNECT_TIMEOUT_SEC, TimeUnit.SECONDS);
ZkBaseDataAccessor<ZNRecord> baseDataAccessor = new ZkBaseDataAccessor<>(zkClient);
ZKHelixDataAccessor zkHelixDataAccessor = new ZKHelixDataAccessor(_clusterName, baseDataAccessor);
PropertyKey property = zkHelixDataAccessor.keyBuilder().liveInstances();
代码示例来源: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: apache/helix
@Override
public boolean verify() {
try {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
return verifyBestPossAndExtView(accessor, errStates, clusterName, resources);
} catch (Exception e) {
LOG.error("exception in verification", e);
}
return false;
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public boolean verify() {
try {
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
return verifyMasterNbInExtView(accessor);
} catch (Exception e) {
LOG.error("exception in verification", e);
}
return false;
}
代码示例来源:origin: org.apache.helix/helix-core
public ClusterVerifier(ZkClient zkclient, String clusterName) {
_zkclient = zkclient;
_clusterName = clusterName;
_accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkclient));
_keyBuilder = _accessor.keyBuilder();
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public boolean verify() {
try {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
return verifyBestPossAndExtView(accessor, errStates, clusterName, resources);
} catch (Exception e) {
LOG.error("exception in verification", e);
}
return false;
}
代码示例来源:origin: org.apache.helix/helix-core
public ZkHelixClusterVerifier(ZkClient zkClient, String clusterName) {
if (zkClient == null || clusterName == null) {
throw new IllegalArgumentException("requires zkClient|clusterName");
}
_zkClient = zkClient;
_clusterName = clusterName;
_accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
_keyBuilder = _accessor.keyBuilder();
}
代码示例来源:origin: org.apache.helix/helix-core
public ZkHelixClusterVerifier(String zkAddr, String clusterName) {
if (zkAddr == null || clusterName == null) {
throw new IllegalArgumentException("requires zkAddr|clusterName");
}
_zkClient = ZKClientPool.getZkClient(zkAddr);
_clusterName = clusterName;
_accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
_keyBuilder = _accessor.keyBuilder();
}
代码示例来源:origin: apache/helix
@Override
public IdealState getResourceIdealState(String clusterName, String resourceName) {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
return accessor.getProperty(keyBuilder.idealStates(resourceName));
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public ExternalView getResourceExternalView(String clusterName, String resourceName) {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
return accessor.getProperty(keyBuilder.externalView(resourceName));
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public StateModelDefinition getStateModelDef(String clusterName,
String stateModelName) {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
return accessor.getProperty(keyBuilder.stateModelDef(stateModelName));
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public IdealState getResourceIdealState(String clusterName, String resourceName) {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
return accessor.getProperty(keyBuilder.idealStates(resourceName));
}
代码示例来源:origin: apache/helix
public static String getPropertyAsString(ZkClient zkClient, String clusterName,
PropertyKey propertyKey, MediaType mediaType) throws JsonGenerationException,
JsonMappingException, IOException {
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
ZNRecord record = EMPTY_ZNRECORD;
HelixProperty property = accessor.getProperty(propertyKey);
if (property != null) {
record = property.getRecord();
}
return ObjectToJson(record);
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void setResourceIdealState(String clusterName, String resourceName,
IdealState idealState) {
logger
.info("Set IdealState for resource {} in cluster {} with new IdealState {}.", resourceName,
clusterName, idealState == null ? "NULL" : idealState.toString());
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
accessor.setProperty(keyBuilder.idealStates(resourceName), idealState);
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public ClusterConstraints getConstraints(String clusterName,
ConstraintType constraintType) {
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = new Builder(clusterName);
return accessor.getProperty(keyBuilder.constraint(constraintType.toString()));
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void dropResource(String clusterName, String resourceName) {
logger.info("Drop resource {} from cluster {}", resourceName, clusterName);
HelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
accessor.removeProperty(keyBuilder.idealStates(resourceName));
accessor.removeProperty(keyBuilder.resourceConfig(resourceName));
}
代码示例来源:origin: apache/helix
public static String getInstanceSessionId(ZkClient zkClient, String clusterName,
String instanceName) {
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
Builder keyBuilder = accessor.keyBuilder();
ZNRecord liveInstance = accessor.getProperty(keyBuilder.liveInstance(instanceName)).getRecord();
return liveInstance.getSimpleField(LiveInstanceProperty.SESSION_ID.toString());
}
代码示例来源:origin: apache/helix
protected void setupLiveInstances(String clusterName, int[] liveInstances) {
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
Builder keyBuilder = accessor.keyBuilder();
for (int i = 0; i < liveInstances.length; i++) {
String instance = "localhost_" + liveInstances[i];
LiveInstance liveInstance = new LiveInstance(instance);
liveInstance.setSessionId("session_" + liveInstances[i]);
liveInstance.setHelixVersion("0.0.0");
accessor.setProperty(keyBuilder.liveInstance(instance), liveInstance);
}
}
我创建了一个带有列表框和按钮的网页,问题是当页面加载时,两个组件的右侧都会出现一个空白区域,但是如果调整页面大小,这些空白区域就会消失。
我正在使用 ZK 图表进行项目使用 MVC 方法,我想做的就是更改背景或向特定列添加指南(具有不同颜色),例如索引为 3 的列:我想要实现的目标 这是我的图表: 这是我想要的,在索引为 3 的列中使用
我正在集成 jquery 和 zk 项目。我的目标是将值从 js/jquery 端传递到 java 端,但徒劳无功。这是我引用的代码:use zAu to send data from client
尝试通过 ZK 6.0.1 Component Development Essentials 创建自定义 UI 组件。尝试使用自定义组件时,日志中总是出现错误“http://localhost:808
我正在使用 Zk 框架并尝试从 zhtml 页面获取 url 参数。我试过: Executions.getCurrent().getParameter("param"); 尽管我在客户端尝试了 zsc
您好,我正在尝试比较 zk 和 gwt 的性能。 在我的比较中,如果框架本身将一些代码转换为 js 就可以了(比如 gwt),我不能自己编写任何 javascript,但我不能自己编写 js 在以上述
当 ZK 组件被销毁或分离时,是否有可能通知监听器? 我希望不同的组件组合器通过事件队列进行通信。为此,我将这些组件的监听器订阅到事件队列。现在我需要知道组件或其 Composer 何时被销毁才能取消
我用 struts 1 配置了 zk。我创建了一个列表并在 session 中设置。 List nameList = new ArrayList(); nameList.add( "xxx" ); n
我想基于 zk 组合框制作新的 zk 组件,以保存以前输入的历史记录。我想将这些先前的输入存储在客户端的 localStorage 中。所以我必须使用 JavaScript 在客户端填充组合框,但不知
我在我的应用程序中使用 ZK colorbox,我想将 Colorbox 的 getRGB() 方法的 RGB 值转换为十六进制。 我有什么办法可以做到这一点吗? 最佳答案 您可以使用 org.zko
是否可以将 Spring bean 直接注入(inject)到 ZK backing bean 中? 在教程中,例如 this我只找到了一个示例,其中应用程序上下文是从复杂的 Web 应用程序中手动提
本文整理了Java中org.apache.ignite.spi.discovery.zk.internal.ZookeeperClient.zk()方法的一些代码示例,展示了ZookeeperClie
我安装了 Eclipse Juno 并添加了 ZK Studio 插件。我的Java JDK是1.5。 但是,当我尝试创建新项目时,出现如下错误: The selected wizard could
我收到以下异常 org.zkoss.zk.ui.UiException 和 java.lang.NumberFormatException。有人可以帮忙吗?我的堆栈跟踪如下: Nov 08, 2013
我正在尝试对现有的 ZK Controller 进行单元测试,并且我想找到一种方法来在对我的 Controller 进行单元测试时处理如下调用, Sessions.getCurrent().setAt
我正在运行 Spark 2.0.2 和 Mesos 0.28.2。 我正在尝试向 Spark 提交一个应用程序,使用 ZooKeeper 管理的 Mesos 集群作为主节点: $SPARK_HOME/
当我在MVVM方法的包含页面中使用Hflex属性时,它不起作用。 当我在另一个页面中包含某个页面时,就会发生此问题,并且此页面的组件的大小由hflex属性控制。我已经尝试过在父窗口加载时使用inval
我在带有zk-grails插件的grails 2.3.11中有一个应用程序。当我执行Spring Security Core集成进行身份验证时,zul页面会停止响应,并出现以下错误:“服务器暂时无法使
ZK支持检查元素是否有焦点吗? HtmlBasedComponent 具有 focus() 和 setFocus(boolean) 来设置焦点..但我没有看到任何 getFocus(). 具体来说,我
关于如何干净、稳健地将用户重定向回上一页有什么想法吗? 如果上一页位于应用程序本身内,我只关心将它们重定向回来。我曾考虑过在用户的 session 中存储某种 DIY 历史记录,但这似乎并不干净或健壮
我是一名优秀的程序员,十分优秀!