gpt4 book ai didi

org.apache.helix.ZNRecord.setLongField()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 06:40:40 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.helix.ZNRecord.setLongField()方法的一些代码示例,展示了ZNRecord.setLongField()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setLongField()方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:setLongField

ZNRecord.setLongField介绍

[英]Set a single simple long field
[中]设置一个简单的长字段

代码示例

代码示例来源:origin: apache/incubator-pinot

@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;
}

代码示例来源: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

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);

代码示例来源:origin: apache/incubator-pinot

@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;
}

代码示例来源:origin: apache/incubator-pinot

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;
}

代码示例来源: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: 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

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());

代码示例来源:origin: apache/incubator-pinot

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());

代码示例来源:origin: org.apache.helix/helix-core

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

代码示例来源:origin: org.apache.helix/helix-core

/**
 * Set the time that this message was read
 * @param time UNIX timestamp
 */
public void setReadTimeStamp(long time) {
 _record.setLongField(Attributes.READ_TIMESTAMP.toString(), time);
}

代码示例来源:origin: org.apache.helix/helix-core

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

代码示例来源:origin: apache/helix

/**
 * Set the time that this message was read
 * @param time UNIX timestamp
 */
public void setReadTimeStamp(long time) {
 _record.setLongField(Attributes.READ_TIMESTAMP.toString(), time);
}

代码示例来源:origin: apache/helix

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

代码示例来源:origin: apache/helix

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

代码示例来源:origin: apache/helix

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

代码示例来源:origin: org.apache.helix/helix-core

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

代码示例来源:origin: apache/helix

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

代码示例来源:origin: apache/helix

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

代码示例来源:origin: org.apache.helix/helix-core

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

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com