@Override public ZNRecord toZNRecord() { ZNRecord znRecord = super.toZNRecord(); znRecord.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, _downloadUrl); znRecord.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, _pushTime); znRecord.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, _refreshTime); return znRecord; }
@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; }
znRecord.setEnumField(CommonConstants.Segment.TIME_UNIT, _timeUnit); znRecord.setLongField(CommonConstants.Segment.START_TIME, _startTime); znRecord.setLongField(CommonConstants.Segment.END_TIME, _endTime); znRecord.setLongField(CommonConstants.Segment.TOTAL_DOCS, _totalRawDocs); znRecord.setLongField(CommonConstants.Segment.CRC, _crc); znRecord.setLongField(CommonConstants.Segment.CREATION_TIME, _creationTime); znRecord.setLongField(CommonConstants.Segment.SEGMENT_UPLOAD_START_TIME, _segmentUploadStartTime);
@Override public ZNRecord toZNRecord() { ZNRecord znRecord = super.toZNRecord(); znRecord.setSimpleField(CommonConstants.Segment.Realtime.STATUS, _status.toString()); znRecord.setLongField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE, _sizeThresholdToFlushSegment); znRecord.setSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_TIME, _timeThresholdToFlushSegment); return znRecord; }
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; }
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.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.TIME_UNIT, TimeUnit.HOURS.toString()); znrecord.setLongField(CommonConstants.Segment.TOTAL_DOCS, 10000); znrecord.setLongField(CommonConstants.Segment.CRC, 1234); znrecord.setLongField(CommonConstants.Segment.CREATION_TIME, 3000); znrecord.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, "http://localhost:8000/myTable_0"); znrecord.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, System.currentTimeMillis()); znrecord.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, System.currentTimeMillis());
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.TIME_UNIT, TimeUnit.HOURS.toString()); znrecord.setLongField(CommonConstants.Segment.TOTAL_DOCS, 10000); znrecord.setLongField(CommonConstants.Segment.CRC, 1234); znrecord.setLongField(CommonConstants.Segment.CREATION_TIME, 3000); znrecord.setSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL, "http://localhost:8000/myTable_0"); znrecord.setLongField(CommonConstants.Segment.Offline.PUSH_TIME, System.currentTimeMillis()); znrecord.setLongField(CommonConstants.Segment.Offline.REFRESH_TIME, System.currentTimeMillis());
/** * Set the period that controller should sync up its local cache and perform a rebalance. * @param milliseconds */ public void setRebalanceTimePeriod(long milliseconds) { _record.setLongField(ClusterConfigProperty.REBALANCE_TIMER_PERIOD.name(), milliseconds); }
/** * Set the time that this message was read * @param time UNIX timestamp */ public void setReadTimeStamp(long time) { _record.setLongField(Attributes.READ_TIMESTAMP.toString(), time); }
/** * Set expiry period for this message. * A message will be expired after this period of time from either its 1) creationTime or 2) * relayTime if it is relay message. * Default is -1 if it is not set. * * @param expiry */ public void setExpiryPeriod(long expiry) { _record.setLongField(Attributes.EXPIRY_PERIOD.name(), expiry); }
/** * Set the time that this message was read * @param time UNIX timestamp */ public void setReadTimeStamp(long time) { _record.setLongField(Attributes.READ_TIMESTAMP.toString(), time); }
/** * Set expiry period for this message. * A message will be expired after this period of time from either its 1) creationTime or 2) * relayTime if it is relay message. * Default is -1 if it is not set. * * @param expiry */ public void setExpiryPeriod(long expiry) { _record.setLongField(Attributes.EXPIRY_PERIOD.name(), expiry); }
/** * Set the period that controller should sync up its local cache and perform a rebalance. * @param milliseconds */ public void setRebalanceTimePeriod(long milliseconds) { _record.setLongField(ClusterConfigProperty.REBALANCE_TIMER_PERIOD.name(), milliseconds); }
/** * Set the completion time of previous task associated with this message. * This applies only when this is a relay message, * which specified the completion time of the task running on the participant that sent this relay message. * * @param completionTime */ public void setRelayTime(long completionTime) { _record.setLongField(Attributes.RELAY_TIME.name(), completionTime); }
/** * Instantiate with a pre-populated record * @param record a ZNRecord corresponding to health statistics */ public HealthStat(ZNRecord record) { super(record); if (getCreateTimeStamp() == 0) { _record.setLongField(Attributes.CREATE_TIMESTAMP.toString(), new Date().getTime()); } }
/** * Instantiate with a pre-populated record * @param record a ZNRecord corresponding to health statistics */ public HealthStat(ZNRecord record) { super(record); if (getCreateTimeStamp() == 0) { _record.setLongField(Attributes.CREATE_TIMESTAMP.toString(), new Date().getTime()); } }
/** * Set the enabled state of the instance * * @param enabled true to enable, false to disable */ public void setInstanceEnabled(boolean enabled) { _record.setBooleanField(InstanceConfigProperty.HELIX_ENABLED.toString(), enabled); _record.setLongField(InstanceConfigProperty.HELIX_ENABLED_TIMESTAMP.name(), System.currentTimeMillis()); }
/** * Set the enabled state of the instance * * @param enabled true to enable, false to disable */ public void setInstanceEnabled(boolean enabled) { _record.setBooleanField(InstanceConfigProperty.HELIX_ENABLED.toString(), enabled); _record.setLongField(InstanceConfigProperty.HELIX_ENABLED_TIMESTAMP.name(), System.currentTimeMillis()); }