org.apache.helix.ZNRecord.setEnumField()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.apache.helix.ZNRecord.setEnumField()方法的一些代码示例,展示了ZNRecord.setEnumField()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setEnumField()方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:setEnumField

ZNRecord.setEnumField介绍

[英]Set a single simple Enum field
[中]设置一个简单的枚举字段

代码示例

代码示例来源:origin: apache/incubator-pinot

znRecord.setEnumField(CommonConstants.Segment.SEGMENT_TYPE, _segmentType);
if (_timeUnit == null) {
 znRecord.setSimpleField(CommonConstants.Segment.TIME_UNIT, NULL);
} else {
 znRecord.setEnumField(CommonConstants.Segment.TIME_UNIT, _timeUnit);

代码示例来源: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 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

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);

代码示例来源:origin: apache/incubator-pinot

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);

代码示例来源: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/helix

/**
 * Set the type of instance that the source node is
 * @param type {@link InstanceType}
 */
public void setSrcInstanceType(InstanceType type) {
 _record.setEnumField(Attributes.SRC_INSTANCE_TYPE.toString(), type);
}

代码示例来源:origin: org.apache.helix/helix-core

/**
 * Set the type of instance that the source node is
 * @param type {@link InstanceType}
 */
public void setSrcInstanceType(InstanceType type) {
 _record.setEnumField(Attributes.SRC_INSTANCE_TYPE.toString(), type);
}

代码示例来源:origin: org.apache.helix/helix-core

/**
 * Set the rebalance mode of the resource
 * @param rebalancerType
 */
public void setRebalanceMode(RebalanceMode rebalancerType) {
 _record.setEnumField(IdealStateProperty.REBALANCE_MODE.toString(), rebalancerType);
 IdealStateModeProperty idealStateMode = denormalizeRebalanceMode(rebalancerType);
 _record.setEnumField(IdealStateProperty.IDEAL_STATE_MODE.toString(), idealStateMode);
}

代码示例来源:origin: apache/helix

/**
 * Set the rebalance mode of the resource
 * @param rebalancerType
 */
public void setRebalanceMode(RebalanceMode rebalancerType) {
 _record.setEnumField(IdealStateProperty.REBALANCE_MODE.toString(), rebalancerType);
 IdealStateModeProperty idealStateMode = denormalizeRebalanceMode(rebalancerType);
 _record.setEnumField(IdealStateProperty.IDEAL_STATE_MODE.toString(), idealStateMode);
}

代码示例来源:origin: apache/helix

/**
 * Set the rebalance mode of the ideal state
 * @param mode {@link IdealStateModeProperty}
 */
@Deprecated
public void setIdealStateMode(String mode) {
 _record.setSimpleField(IdealStateProperty.IDEAL_STATE_MODE.toString(), mode);
 RebalanceMode rebalanceMode = normalizeRebalanceMode(IdealStateModeProperty.valueOf(mode));
 _record.setEnumField(IdealStateProperty.REBALANCE_MODE.toString(), rebalanceMode);
}

代码示例来源:origin: org.apache.helix/helix-core

/**
 * Set the rebalance mode of the ideal state
 * @param mode {@link IdealStateModeProperty}
 */
@Deprecated
public void setIdealStateMode(String mode) {
 _record.setSimpleField(IdealStateProperty.IDEAL_STATE_MODE.toString(), mode);
 RebalanceMode rebalanceMode = normalizeRebalanceMode(IdealStateModeProperty.valueOf(mode));
 _record.setEnumField(IdealStateProperty.REBALANCE_MODE.toString(), rebalanceMode);
}

相关文章