@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; }
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; }
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; }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
ParticipantCapacity(String dimensionName) { super(dimensionName); _record .setIntField(ParticipantCapacityProperty.DEFAULT_CAPACITY.name(), DEFAULT_CAPACITY_VALUE); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
ParticipantCapacity(String dimensionName) { super(dimensionName); _record .setIntField(ParticipantCapacityProperty.DEFAULT_CAPACITY.name(), DEFAULT_CAPACITY_VALUE); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }