本文整理了Java中org.apache.helix.ZNRecord.setIntField()
方法的一些代码示例,展示了ZNRecord.setIntField()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setIntField()
方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:setIntField
[英]Set a single simple int field
[中]设置一个简单的整型字段
代码示例来源: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
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: org.apache.helix/helix-core
/**
* Set the threshold for the number of partitions needing recovery or in error. Default value is set at
* Integer.MAX_VALUE to allow recovery rebalance and load rebalance to happen in the same pipeline
* cycle. If the number of partitions needing recovery is greater than this threshold, recovery
* balance will take precedence and load balance will not happen during this cycle.
* @param recoveryPartitionThreshold
*/
public void setErrorOrRecoveryPartitionThresholdForLoadBalance(int recoveryPartitionThreshold) {
_record.setIntField(ClusterConfigProperty.ERROR_OR_RECOVERY_PARTITION_THRESHOLD_FOR_LOAD_BALANCE.name(),
recoveryPartitionThreshold);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Set the number of partitions of this resource
* @param numPartitions the number of partitions
*/
public void setNumPartitions(int numPartitions) {
_record.setIntField(IdealStateProperty.NUM_PARTITIONS.toString(), numPartitions);
}
代码示例来源:origin: apache/helix
/**
* Set the max offline instances allowed for the cluster. If number of pff-line or disabled instances
* in the cluster reach this limit, Helix will pause the cluster.
*
* @param maxOfflineInstancesAllowed
*/
public void setMaxOfflineInstancesAllowed(int maxOfflineInstancesAllowed) {
_record.setIntField(ClusterConfigProperty.MAX_OFFLINE_INSTANCES_ALLOWED.name(),
maxOfflineInstancesAllowed);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Set the maximum number of partitions of this resource that an instance can serve
* @param max the maximum number of partitions supported
*/
public void setMaxPartitionsPerInstance(int max) {
_record.setIntField(IdealStateProperty.MAX_PARTITIONS_PER_INSTANCE.toString(), max);
}
代码示例来源:origin: org.apache.helix/helix-core
ParticipantCapacity(String dimensionName) {
super(dimensionName);
_record
.setIntField(ParticipantCapacityProperty.DEFAULT_CAPACITY.name(), DEFAULT_CAPACITY_VALUE);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Set the number of times to retry message handling on timeouts
* @param retryCount maximum number of retries
*/
public void setRetryCount(int retryCount) {
_record.setIntField(Attributes.RETRY_COUNT.toString(), retryCount);
}
代码示例来源:origin: apache/helix
/**
* Set the maximum number of partitions of this resource that an instance can serve
* @param max the maximum number of partitions supported
*/
public void setMaxPartitionsPerInstance(int max) {
_record.setIntField(IdealStateProperty.MAX_PARTITIONS_PER_INSTANCE.toString(), max);
}
代码示例来源:origin: apache/helix
/**
* Set the time to wait before stopping execution of this message
* @param timeout the timeout in ms, or -1 indicating no timeout
*/
public void setExecutionTimeout(int timeout) {
_record.setIntField(Attributes.TIMEOUT.toString(), timeout);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Set the maximum number of partitions that an instance can serve in this cluster.
*
* @param maxPartitionsPerInstance the maximum number of partitions supported
*/
public void setMaxPartitionsPerInstance(int maxPartitionsPerInstance) {
_record.setIntField(ClusterConfigProperty.MAX_PARTITIONS_PER_INSTANCE.name(),
maxPartitionsPerInstance);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Set the max offline instances allowed for the cluster. If number of pff-line or disabled instances
* in the cluster reach this limit, Helix will pause the cluster.
*
* @param maxOfflineInstancesAllowed
*/
public void setMaxOfflineInstancesAllowed(int maxOfflineInstancesAllowed) {
_record.setIntField(ClusterConfigProperty.MAX_OFFLINE_INSTANCES_ALLOWED.name(),
maxOfflineInstancesAllowed);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Set view cluster max refresh period
* @param refreshPeriod refresh period in second
*/
public void setViewClusterRefreshPeriod(int refreshPeriod) {
_record.setIntField(ClusterConfigProperty.VIEW_CLUSTER_REFRESH_PERIOD.name(),
refreshPeriod);
}
代码示例来源:origin: apache/helix
/**
* Set view cluster max refresh period
* @param refreshPeriod refresh period in second
*/
public void setViewClusterRefreshPeriod(int refreshPeriod) {
_record.setIntField(ClusterConfigProperty.VIEW_CLUSTER_REFRESH_PERIOD.name(),
refreshPeriod);
}
代码示例来源:origin: apache/helix
ParticipantCapacity(String dimensionName) {
super(dimensionName);
_record
.setIntField(ParticipantCapacityProperty.DEFAULT_CAPACITY.name(), DEFAULT_CAPACITY_VALUE);
}
代码示例来源:origin: apache/helix
/**
* Set maximum allowed error partitions for a resource to be load balanced.
* If limitation is set to negative number, Helix won't check error partition count before
* schedule load balance.
* @param errorPartitionThreshold the maximum allowed error partition count
*/
public void setErrorPartitionThresholdForLoadBalance(int errorPartitionThreshold) {
_record.setIntField(ClusterConfigProperty.ERROR_PARTITION_THRESHOLD_FOR_LOAD_BALANCE.name(),
errorPartitionThreshold);
}
代码示例来源:origin: apache/helix
/**
* Set the threshold for the number of partitions needing recovery or in error. Default value is set at
* Integer.MAX_VALUE to allow recovery rebalance and load rebalance to happen in the same pipeline
* cycle. If the number of partitions needing recovery is greater than this threshold, recovery
* balance will take precedence and load balance will not happen during this cycle.
* @param recoveryPartitionThreshold
*/
public void setErrorOrRecoveryPartitionThresholdForLoadBalance(int recoveryPartitionThreshold) {
_record.setIntField(ClusterConfigProperty.ERROR_OR_RECOVERY_PARTITION_THRESHOLD_FOR_LOAD_BALANCE.name(),
recoveryPartitionThreshold);
}
代码示例来源:origin: apache/helix
/**
* Set the number of minimal active partitions for this resource.
*
* @param minActiveReplicas
*/
public void setMinActiveReplicas(int minActiveReplicas) {
_record.setIntField(IdealStateProperty.MIN_ACTIVE_REPLICAS.toString(), minActiveReplicas);
}
代码示例来源:origin: apache/helix
/**
* Set the number of times to retry message handling on timeouts
* @param retryCount maximum number of retries
*/
public void setRetryCount(int retryCount) {
_record.setIntField(Attributes.RETRY_COUNT.toString(), retryCount);
}
内容来源于网络,如有侵权,请联系作者删除!