- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.helix.ZNRecord.setSimpleField()
方法的一些代码示例,展示了ZNRecord.setSimpleField()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setSimpleField()
方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:setSimpleField
[英]Set a simple key, value field
[中]设置一个简单的键、值字段
代码示例来源:origin: apache/incubator-pinot
@Override
public ZNRecord toZNRecord() {
ZNRecord znRecord = super.toZNRecord();
znRecord.setSimpleField(CommonConstants.Segment.Realtime.STATUS, _status.toString());
znRecord.setLongField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE, _sizeThresholdToFlushSegment);
znRecord.setSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_TIME, _timeThresholdToFlushSegment);
return znRecord;
}
代码示例来源:origin: apache/incubator-pinot
/**
* Wrap {@link Schema} into a {@link ZNRecord}.
*/
public static ZNRecord toZNRecord(@Nonnull Schema schema) {
ZNRecord record = new ZNRecord(schema.getSchemaName());
record.setSimpleField("schemaJSON", schema.getJSONSchema());
return record;
}
代码示例来源:origin: apache/incubator-pinot
@Override
public ZNRecord toZNRecord() {
ZNRecord znRecord = super.toZNRecord();
znRecord.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, _downloadUrl);
znRecord.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, _pushTime);
znRecord.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, _refreshTime);
return znRecord;
}
代码示例来源:origin: apache/incubator-pinot
/**
*
* @param tableName is the offline table name
* @param segmentName is name of the segment
* @param crc is the CRC of the new segment
*/
public SegmentRefreshMessage(String tableName, String segmentName, long crc) {
super(MessageType.USER_DEFINE_MSG, UUID.randomUUID().toString());
setResourceName(tableName);
setPartitionName(segmentName);
setMsgSubType(REFRESH_SEGMENT_MSG_SUB_TYPE);
// Give it infinite time to process the message, as long as session is alive
setExecutionTimeout(-1);
getRecord().setSimpleField(SIMPLE_FIELD_CRC, Long.toString(crc));
}
代码示例来源:origin: apache/incubator-pinot
@Override
public ZNRecord toZNRecord() {
ZNRecord znRecord = new ZNRecord(_segmentName);
znRecord.setSimpleField(CommonConstants.Segment.SEGMENT_NAME, _segmentName);
znRecord.setSimpleField(CommonConstants.Segment.TABLE_NAME, _tableName);
znRecord.setSimpleField(CommonConstants.Segment.CRYPTER_NAME, _crypterName);
znRecord.setSimpleField(CommonConstants.Segment.TIME_UNIT, NULL);
} else {
znRecord.setEnumField(CommonConstants.Segment.TIME_UNIT, _timeUnit);
znRecord.setLongField(CommonConstants.Segment.END_TIME, _endTime);
znRecord.setSimpleField(CommonConstants.Segment.INDEX_VERSION, _indexVersion);
znRecord.setLongField(CommonConstants.Segment.TOTAL_DOCS, _totalRawDocs);
znRecord.setLongField(CommonConstants.Segment.CRC, _crc);
try {
String partitionMetadataJson = _partitionMetadata.toJsonString();
znRecord.setSimpleField(CommonConstants.Segment.PARTITION_METADATA, partitionMetadataJson);
} catch (IOException e) {
LOGGER
代码示例来源:origin: linkedin/ambry
/**
* Add or update a {@link ZNRecord} to include a simple field with the given key and value. If the supplied
* {@link ZNRecord} is null, a new {@link ZNRecord} will be created.
* @param oldRecord A {@link ZNRecord} to add or update its simple field. {@code null} indicates to create a
* new {@link ZNRecord}.
* @param key The key for the simple field.
* @param value The value for the simple field.
* @return A {@link ZNRecord} including a simple field with the given key and value.
*/
private ZNRecord makeZNRecordWithSimpleField(ZNRecord oldRecord, String key, String value) {
ZNRecord zNRecord = oldRecord == null ? new ZNRecord(String.valueOf(System.currentTimeMillis())) : oldRecord;
if (key != null && value != null) {
zNRecord.setSimpleField(key, value);
}
return zNRecord;
}
代码示例来源:origin: apache/incubator-pinot
@Override
public ZNRecord toZNRecord() {
ZNRecord znRecord = super.toZNRecord();
znRecord.setLongField(START_OFFSET, _startOffset);
znRecord.setLongField(END_OFFSET, _endOffset);
znRecord.setIntField(NUM_REPLICAS, _numReplicas);
znRecord.setSimpleField(DOWNLOAD_URL, _downloadUrl);
return znRecord;
}
代码示例来源:origin: apache/incubator-pinot
record.setSimpleField(StateModelDefinitionProperty.INITIAL_STATE.toString(), OFFLINE_STATE);
代码示例来源:origin: apache/incubator-pinot
private ZNRecord getTestOfflineSegmentZNRecord() {
String segmentName = "testTable_O_3000_4000";
ZNRecord record = new ZNRecord(segmentName);
record.setSimpleField(CommonConstants.Segment.SEGMENT_NAME, segmentName);
record.setSimpleField(CommonConstants.Segment.TABLE_NAME, "testTable");
record.setSimpleField(CommonConstants.Segment.CRYPTER_NAME, "testCrypter");
record.setSimpleField(CommonConstants.Segment.INDEX_VERSION, "v1");
record.setEnumField(CommonConstants.Segment.SEGMENT_TYPE, CommonConstants.Segment.SegmentType.OFFLINE);
record.setLongField(CommonConstants.Segment.START_TIME, 1000);
record.setLongField(CommonConstants.Segment.END_TIME, 2000);
record.setSimpleField(CommonConstants.Segment.TIME_UNIT, TimeUnit.HOURS.toString());
record.setLongField(CommonConstants.Segment.TOTAL_DOCS, 50000);
record.setLongField(CommonConstants.Segment.CRC, 54321);
record.setLongField(CommonConstants.Segment.CREATION_TIME, 1000);
record.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, "http://localhost:8000/testTable_O_3000_4000");
record.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, 4000);
record.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, 8000);
return record;
}
代码示例来源:origin: apache/incubator-pinot
public IdealStateBuilderUtil disableIdealState() {
_idealState.getRecord().setSimpleField(IdealState.IdealStateProperty.HELIX_ENABLED.name(), "false");
return this;
}
代码示例来源:origin: apache/incubator-pinot
private ZNRecord getTestInProgressRealtimeSegmentZNRecord() {
String segmentName = "testTable_R_1000_groupId0_part0";
ZNRecord record = new ZNRecord(segmentName);
record.setSimpleField(CommonConstants.Segment.SEGMENT_NAME, segmentName);
record.setSimpleField(CommonConstants.Segment.TABLE_NAME, "testTable");
record.setSimpleField(CommonConstants.Segment.INDEX_VERSION, "v1");
record.setEnumField(CommonConstants.Segment.SEGMENT_TYPE, CommonConstants.Segment.SegmentType.REALTIME);
record.setEnumField(CommonConstants.Segment.Realtime.STATUS, CommonConstants.Segment.Realtime.Status.IN_PROGRESS);
record.setLongField(CommonConstants.Segment.START_TIME, 1000);
record.setLongField(CommonConstants.Segment.END_TIME, -1);
record.setSimpleField(CommonConstants.Segment.TIME_UNIT, TimeUnit.HOURS.toString());
record.setLongField(CommonConstants.Segment.TOTAL_DOCS, -1);
record.setLongField(CommonConstants.Segment.CRC, -1);
record.setLongField(CommonConstants.Segment.CREATION_TIME, 1000);
record.setIntField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE, 1234);
record.setSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_TIME, "6h");
return record;
}
代码示例来源:origin: apache/incubator-pinot
private ZNRecord getTestDoneRealtimeSegmentZNRecord() {
String segmentName = "testTable_R_1000_2000_groupId0_part0";
ZNRecord record = new ZNRecord(segmentName);
record.setSimpleField(CommonConstants.Segment.SEGMENT_NAME, segmentName);
record.setSimpleField(CommonConstants.Segment.TABLE_NAME, "testTable");
record.setSimpleField(CommonConstants.Segment.INDEX_VERSION, "v1");
record.setEnumField(CommonConstants.Segment.SEGMENT_TYPE, CommonConstants.Segment.SegmentType.REALTIME);
record.setEnumField(CommonConstants.Segment.Realtime.STATUS, CommonConstants.Segment.Realtime.Status.DONE);
record.setLongField(CommonConstants.Segment.START_TIME, 1000);
record.setLongField(CommonConstants.Segment.END_TIME, 2000);
record.setSimpleField(CommonConstants.Segment.TIME_UNIT, TimeUnit.HOURS.toString());
record.setLongField(CommonConstants.Segment.TOTAL_DOCS, 10000);
record.setLongField(CommonConstants.Segment.CRC, 1234);
record.setLongField(CommonConstants.Segment.CREATION_TIME, 3000);
record.setIntField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE, 1234);
record.setSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_TIME, "6h");
return record;
}
代码示例来源:origin: apache/incubator-pinot
private void modifyExistingInstanceConfig(ZkClient zkClient)
throws InterruptedException {
String instanceName = "Server_localhost_" + new Random().nextInt(NUM_INSTANCES);
String instanceConfigPath = PropertyPathBuilder.instanceConfig(_helixClusterName, instanceName);
Assert.assertTrue(zkClient.exists(instanceConfigPath));
ZNRecord znRecord = zkClient.readData(instanceConfigPath, null);
InstanceConfig cachedInstanceConfig = _helixResourceManager.getHelixInstanceConfig(instanceName);
String originalPort = cachedInstanceConfig.getPort();
Assert.assertNotNull(originalPort);
String newPort = Long.toString(System.currentTimeMillis());
Assert.assertTrue(!newPort.equals(originalPort));
// Set new port to this instance config.
znRecord.setSimpleField(InstanceConfig.InstanceConfigProperty.HELIX_PORT.toString(), newPort);
zkClient.writeData(instanceConfigPath, znRecord);
long maxTime = System.currentTimeMillis() + MAX_TIMEOUT_IN_MILLISECOND;
InstanceConfig latestCachedInstanceConfig = _helixResourceManager.getHelixInstanceConfig(instanceName);
String latestPort = latestCachedInstanceConfig.getPort();
while (!newPort.equals(latestPort) && System.currentTimeMillis() < maxTime) {
Thread.sleep(100L);
latestCachedInstanceConfig = _helixResourceManager.getHelixInstanceConfig(instanceName);
latestPort = latestCachedInstanceConfig.getPort();
}
Assert.assertTrue(System.currentTimeMillis() < maxTime, "Timeout when waiting for adding instance config");
// Set original port back to this instance config.
znRecord.setSimpleField(InstanceConfig.InstanceConfigProperty.HELIX_PORT.toString(), originalPort);
zkClient.writeData(instanceConfigPath, znRecord);
}
代码示例来源:origin: apache/incubator-pinot
znRecord.setSimpleField(CommonConstants.Segment.PARTITION_METADATA, expectedPartitionMetadata.toJsonString());
SegmentZKMetadata expectedSegmentMetadata = new OfflineSegmentZKMetadata(znRecord);
SegmentPartitionMetadata actualPartitionMetadata = expectedSegmentMetadata.getPartitionMetadata();
znRecord.setSimpleField(CommonConstants.Segment.PARTITION_METADATA, expectedPartitionMetadata.toJsonString());
expectedSegmentMetadata = new RealtimeSegmentZKMetadata(znRecord);
代码示例来源:origin: apache/incubator-pinot
InstanceConfig instanceConfig = new InstanceConfig("Server_localhost_1234");
instanceConfigs.add(instanceConfig);
instanceConfig.getRecord().setSimpleField(CommonConstants.Helix.IS_SHUTDOWN_IN_PROGRESS, "false");
代码示例来源:origin: apache/incubator-pinot
@Test
public void testRoutingTableExcludesDisabledAndRebootingInstances() {
final String tableName = "fakeTable_OFFLINE";
final int segmentCount = 100;
final int replicationFactor = 6;
final int instanceCount = 50;
ExternalView externalView = createExternalView(tableName, segmentCount, replicationFactor, instanceCount);
List<InstanceConfig> instanceConfigs = createInstanceConfigs(instanceCount);
final InstanceConfig disabledHelixInstance = instanceConfigs.get(0);
final String disabledHelixInstanceName = disabledHelixInstance.getInstanceName();
disabledHelixInstance.setInstanceEnabled(false);
final InstanceConfig shuttingDownInstance = instanceConfigs.get(1);
final String shuttingDownInstanceName = shuttingDownInstance.getInstanceName();
shuttingDownInstance.getRecord()
.setSimpleField(CommonConstants.Helix.IS_SHUTDOWN_IN_PROGRESS, Boolean.toString(true));
validateAssertionForOneRoutingTable(new RoutingTableValidator() {
@Override
public boolean isRoutingTableValid(Map<String, List<String>> routingTable, ExternalView externalView,
List<InstanceConfig> instanceConfigs) {
for (String serverName : routingTable.keySet()) {
// These servers should not appear in the routing table
if (serverName.equals(disabledHelixInstanceName) || serverName.equals(shuttingDownInstanceName)) {
return false;
}
}
return true;
}
}, "Routing table should not contain disabled instances", externalView, instanceConfigs, tableName);
}
代码示例来源:origin: apache/incubator-pinot
InstanceConfig instanceConfig = new InstanceConfig(instanceName);
instanceConfigs.add(instanceConfig);
instanceConfig.getRecord().setSimpleField(CommonConstants.Helix.IS_SHUTDOWN_IN_PROGRESS, "false");
代码示例来源:origin: apache/incubator-pinot
InstanceConfig instanceConfig = new InstanceConfig("Server_localhost_1234");
instanceConfigs.add(instanceConfig);
instanceConfig.getRecord().setSimpleField(CommonConstants.Helix.IS_SHUTDOWN_IN_PROGRESS, "true");
代码示例来源:origin: apache/incubator-pinot
znrecord.setSimpleField(CommonConstants.Segment.SEGMENT_NAME, "myTable_0");
znrecord.setSimpleField(CommonConstants.Segment.TABLE_NAME, "myTable_OFFLINE");
znrecord.setSimpleField(CommonConstants.Segment.INDEX_VERSION, "v1");
znrecord.setEnumField(CommonConstants.Segment.SEGMENT_TYPE, CommonConstants.Segment.SegmentType.OFFLINE);
znrecord.setLongField(CommonConstants.Segment.START_TIME, 1000);
znrecord.setLongField(CommonConstants.Segment.END_TIME, 2000);
znrecord.setSimpleField(CommonConstants.Segment.TIME_UNIT, TimeUnit.HOURS.toString());
znrecord.setLongField(CommonConstants.Segment.TOTAL_DOCS, 10000);
znrecord.setLongField(CommonConstants.Segment.CRC, 1234);
znrecord.setLongField(CommonConstants.Segment.CREATION_TIME, 3000);
znrecord.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, "http://localhost:8000/myTable_0");
znrecord.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, System.currentTimeMillis());
znrecord.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, System.currentTimeMillis());
代码示例来源:origin: apache/incubator-pinot
znrecord.setSimpleField(CommonConstants.Segment.SEGMENT_NAME, "myTable_0");
znrecord.setSimpleField(CommonConstants.Segment.TABLE_NAME, "myTable_OFFLINE");
znrecord.setSimpleField(CommonConstants.Segment.INDEX_VERSION, "v1");
znrecord.setEnumField(CommonConstants.Segment.SEGMENT_TYPE, CommonConstants.Segment.SegmentType.OFFLINE);
znrecord.setLongField(CommonConstants.Segment.START_TIME, 1000);
znrecord.setLongField(CommonConstants.Segment.END_TIME, 2000);
znrecord.setSimpleField(CommonConstants.Segment.TIME_UNIT, TimeUnit.HOURS.toString());
znrecord.setLongField(CommonConstants.Segment.TOTAL_DOCS, 10000);
znrecord.setLongField(CommonConstants.Segment.CRC, 1234);
znrecord.setLongField(CommonConstants.Segment.CREATION_TIME, 3000);
znrecord.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, "http://localhost:8000/myTable_0");
znrecord.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, System.currentTimeMillis());
znrecord.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, System.currentTimeMillis());
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Sample data for IPv6? 除了 wireshark 在其网站上提供的内容之外,是否有可以下
我正在寻找可以集成到现有应用程序中并使用多拖放功能的示例或任何现成的解决方案。我在互联网上找到的大多数解决方案在将多个项目从 ListBox 等控件拖放到另一个 ListBox 时效果不佳。谁能指出我
我是 GATE Embedded 的新手,我尝试了简单的示例并得到了 NoClassDefFoundError。首先我会解释我尝试了什么 在 D:\project\gate-7.0 中下载并提取 Ga
是否有像 Eclipse 中的 SWT 示例那样的多合一 JFace 控件示例?搜索(在 stackoverflow.com 上使用谷歌搜索和搜索)对我没有帮助。 如果它是一个独立的应用程序或 ecl
我找不到任何可以清楚地解释如何通过 .net API(特别是 c#)使用谷歌计算引擎的内容。有没有人可以指点我什么? 附言我知道 API 引用 ( https://developers.google.
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
我正在尝试为我的应用程序设计配置文件格式并选择了 YAML。但是,这(显然)意味着我需要能够定义、解析和验证正确的 YAML 语法! 在配置文件中,必须有一个名为 widgets 的集合/序列。 .这
你能给我一个使用 pysmb 库连接到一些 samba 服务器的例子吗?我读过有类 smb.SMBConnection.SMBConnection(用户名、密码、my_name、remote_name
linux服务器默认通过22端口用ssh协议登录,这种不安全。今天想做限制,即允许部分来源ip连接服务器。 案例目标:通过iptables规则限制对linux服务器的登录。 处理方法:编
我一直在寻找任何 PostProjectAnalysisTask 工作代码示例,但没有看。 This页面指出 HipChat plugin使用这个钩子(Hook),但在我看来它仍然使用遗留的 Po
我发现了 GWT 的 CustomScrollPanel 以及如何自定义滚动条,但我找不到任何示例或如何设置它。是否有任何示例显示正在使用的自定义滚动条? 最佳答案 这是自定义 native 滚动条的
我正在尝试开发一个 Backbone Marionette 应用程序,我需要知道如何以最佳方式执行 CRUD(创建、读取、更新和销毁)操作。我找不到任何解释这一点的资源(仅适用于 Backbone)。
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题?通过 editing this post 添加详细信息并澄清问题. 去年关闭。 Improve this
我需要一个提交多个单独请求的 django 表单,如果没有大量定制,我找不到如何做到这一点的示例。即,假设有一个汽车维修店使用的表格。该表格将列出商店能够进行的所有可能的维修,并且用户将选择他们想要进
我有一个 Multi-Tenancy 应用程序。然而,这个相同的应用程序有 liquibase。我需要在我的所有数据源中运行 liquibase,但是我不能使用这个 Bean。 我的应用程序.yml
我了解有关单元测试的一般思想,并已在系统中发生复杂交互的场景中使用它,但我仍然对所有这些原则结合在一起有疑问。 我们被警告不要测试框架或数据库。好的 UI 设计不适合非人工测试。 MVC 框架不包括一
我正在使用 docjure并且它的 select-columns 函数需要一个列映射。我想获取所有列而无需手动指定。 如何将以下内容生成为惰性无限向量序列 [:A :B :C :D :E ... :A
$condition使用说明和 $param在 findByAttributes在 Yii 在大多数情况下,这就是我使用 findByAttributes 的方式 Person::model()->f
我在 Ubuntu 11.10 上安装了 qtcreator sudo apt-get install qtcreator 安装的版本有:QT Creator 2.2.1、QT 4.7.3 当我启动
我是一名优秀的程序员,十分优秀!