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);
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; }
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; }
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.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);
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; }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }