- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.helix.ZNRecord.setLongField()
方法的一些代码示例,展示了ZNRecord.setLongField()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setLongField()
方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称: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());
}
本文整理了Java中org.apache.helix.ZNRecord.setLongField()方法的一些代码示例,展示了ZNRecord.setLongField()的具体用法。这些代码示例主要
我是一名优秀的程序员,十分优秀!