本文整理了Java中org.apache.helix.ZNRecord.getIntField()
方法的一些代码示例,展示了ZNRecord.getIntField()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.getIntField()
方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:getIntField
[英]Get a single int field
[中]获取一个整型字段
代码示例来源:origin: apache/incubator-pinot
public RealtimeSegmentZKMetadata(ZNRecord znRecord) {
super(znRecord);
setSegmentType(SegmentType.REALTIME);
_status = Status.valueOf(znRecord.getSimpleField(CommonConstants.Segment.Realtime.STATUS));
_sizeThresholdToFlushSegment = znRecord.getIntField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE, -1);
String flushThresholdTime = znRecord.getSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_TIME);
if (flushThresholdTime != null && !flushThresholdTime.equals(NULL)) {
_timeThresholdToFlushSegment = znRecord.getSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_TIME);
}
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get maximum allowed running task count on this instance
* @return the maximum task count
*/
public int getMaxConcurrentTask() {
return _record.getIntField(InstanceConfigProperty.MAX_CONCURRENT_TASK.name(), MAX_CONCURRENT_TASK_NOT_SET);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get the time to wait before stopping execution of this message
* @return the timeout in ms, or -1 indicating no timeout
*/
public int getExecutionTimeout() {
return _record.getIntField(Attributes.TIMEOUT.toString(), -1);
}
代码示例来源:origin: apache/helix
/**
* Get maximum allowed running task count on this instance
* @return the maximum task count
*/
public int getMaxConcurrentTask() {
return _record.getIntField(InstanceConfigProperty.MAX_CONCURRENT_TASK.name(), MAX_CONCURRENT_TASK_NOT_SET);
}
代码示例来源:origin: apache/helix
/**
* Get the max offline instances allowed for the cluster.
*
* @return
*/
public int getMaxOfflineInstancesAllowed() {
return _record.getIntField(ClusterConfigProperty.MAX_OFFLINE_INSTANCES_ALLOWED.name(), -1);
}
代码示例来源:origin: apache/helix
/**
* Get the number of minimal active partitions for this resource.
*
* @return
*/
public int getMinActiveReplicas() {
return _record.getIntField(IdealStateProperty.MIN_ACTIVE_REPLICAS.toString(), -1);
}
代码示例来源:origin: apache/helix
/**
* Get the time to wait before stopping execution of this message
* @return the timeout in ms, or -1 indicating no timeout
*/
public int getExecutionTimeout() {
return _record.getIntField(Attributes.TIMEOUT.toString(), -1);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get the max offline instances allowed for the cluster.
*
* @return
*/
public int getMaxOfflineInstancesAllowed() {
return _record.getIntField(ClusterConfigProperty.MAX_OFFLINE_INSTANCES_ALLOWED.name(), -1);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get the number of partitions of this resource
* @return the number of partitions
*/
public int getNumPartitions() {
return _record.getIntField(ResourceConfigProperty.NUM_PARTITIONS.name(), 0);
}
代码示例来源:origin: apache/helix
/**
* Get the maximum number of partitions an instance can serve in this cluster.
*
* @return the partition capacity of an instance for this resource, or Integer.MAX_VALUE
*/
public int getMaxPartitionsPerInstance() {
return _record.getIntField(ClusterConfigProperty.MAX_PARTITIONS_PER_INSTANCE.name(), -1);
}
代码示例来源:origin: apache/helix
/**
* Get maximum allowed running task count on all instances in this cluster.
* @return the maximum task count
*/
public int getMaxConcurrentTaskPerInstance() {
return _record.getIntField(ClusterConfigProperty.MAX_CONCURRENT_TASK_PER_INSTANCE.name(),
DEFAULT_MAX_CONCURRENT_TASK_PER_INSTANCE);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get maximum allowed running task count on all instances in this cluster.
* @return the maximum task count
*/
public int getMaxConcurrentTaskPerInstance() {
return _record.getIntField(ClusterConfigProperty.MAX_CONCURRENT_TASK_PER_INSTANCE.name(),
DEFAULT_MAX_CONCURRENT_TASK_PER_INSTANCE);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get the number of minimal active partitions for this resource.
*
* @return
*/
public int getMinActiveReplicas() {
return _record.getIntField(IdealStateProperty.MIN_ACTIVE_REPLICAS.toString(), -1);
}
代码示例来源:origin: apache/helix
/**
* Get 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.
* @return the threshold
*/
public int getErrorOrRecoveryPartitionThresholdForLoadBalance() {
return _record.getIntField(
ClusterConfigProperty.ERROR_OR_RECOVERY_PARTITION_THRESHOLD_FOR_LOAD_BALANCE.name(),
DEFAULT_ERROR_OR_RECOVERY_PARTITION_THRESHOLD_FOR_LOAD_BALANCE);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* This Failure threshold only works for generic workflow. Will be ignored by JobQueue
* @return
*/
public int getFailureThreshold() {
return _record.getIntField(WorkflowConfigProperty.FailureThreshold.name(),
DEFAULT_FAILURE_THRESHOLD);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Determine the number of jobs that this workflow can accept before rejecting further jobs,
* this field is only used when a workflow is not terminable.
* @return queue capacity
*/
public int getCapacity() {
return _record.getIntField(WorkflowConfigProperty.capacity.name(), DEFAULT_CAPACITY);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get the maximum number of partitions an instance can serve in this cluster.
*
* @return the partition capacity of an instance for this resource, or Integer.MAX_VALUE
*/
public int getMaxPartitionsPerInstance() {
return _record.getIntField(ClusterConfigProperty.MAX_PARTITIONS_PER_INSTANCE.name(), -1);
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Get 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.
* @return the threshold
*/
public int getErrorOrRecoveryPartitionThresholdForLoadBalance() {
return _record.getIntField(
ClusterConfigProperty.ERROR_OR_RECOVERY_PARTITION_THRESHOLD_FOR_LOAD_BALANCE.name(),
DEFAULT_ERROR_OR_RECOVERY_PARTITION_THRESHOLD_FOR_LOAD_BALANCE);
}
代码示例来源:origin: org.apache.helix/helix-core
int getWeight(String resource, String partition) {
Map<String, String> partitionWeightMap = _record.getMapField(resource);
if (partitionWeightMap != null && partitionWeightMap.containsKey(partition)) {
return Integer.parseInt(partitionWeightMap.get(partition));
}
return _record.getIntField(getWeightKey(resource), getDefaultWeight());
}
代码示例来源:origin: apache/helix
int getWeight(String resource, String partition) {
Map<String, String> partitionWeightMap = _record.getMapField(resource);
if (partitionWeightMap != null && partitionWeightMap.containsKey(partition)) {
return Integer.parseInt(partitionWeightMap.get(partition));
}
return _record.getIntField(getWeightKey(resource), getDefaultWeight());
}
内容来源于网络,如有侵权,请联系作者删除!