本文整理汇总了Java中org.apache.helix.ZNRecord.getLongField方法的典型用法代码示例。如果您正苦于以下问题:Java ZNRecord.getLongField方法的具体用法?Java ZNRecord.getLongField怎么用?Java ZNRecord.getLongField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.helix.ZNRecord
的用法示例。
在下文中一共展示了ZNRecord.getLongField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OfflineSegmentZKMetadata
import org.apache.helix.ZNRecord; //导入方法依赖的package包/类
public OfflineSegmentZKMetadata(ZNRecord znRecord) {
super(znRecord);
setSegmentType(SegmentType.OFFLINE);
_downloadUrl = znRecord.getSimpleField(CommonConstants.Segment.Offline.DOWNLOAD_URL);
_pushTime = znRecord.getLongField(CommonConstants.Segment.Offline.PUSH_TIME, Long.MIN_VALUE);
_refreshTime = znRecord.getLongField(CommonConstants.Segment.Offline.REFRESH_TIME, Long.MIN_VALUE);
}
示例2: SegmentZKMetadata
import org.apache.helix.ZNRecord; //导入方法依赖的package包/类
public SegmentZKMetadata(ZNRecord znRecord) {
_segmentName = znRecord.getSimpleField(CommonConstants.Segment.SEGMENT_NAME);
_tableName = znRecord.getSimpleField(CommonConstants.Segment.TABLE_NAME);
_segmentType = znRecord.getEnumField(CommonConstants.Segment.SEGMENT_TYPE, SegmentType.class, SegmentType.OFFLINE);
_startTime = znRecord.getLongField(CommonConstants.Segment.START_TIME, -1);
_endTime = znRecord.getLongField(CommonConstants.Segment.END_TIME, -1);
if (znRecord.getSimpleFields().containsKey(CommonConstants.Segment.TIME_UNIT) &&
!znRecord.getSimpleField(CommonConstants.Segment.TIME_UNIT).equals(NULL)) {
_timeUnit = znRecord.getEnumField(CommonConstants.Segment.TIME_UNIT, TimeUnit.class, TimeUnit.DAYS);
}
_indexVersion = znRecord.getSimpleField(CommonConstants.Segment.INDEX_VERSION);
_totalDocs = znRecord.getLongField(CommonConstants.Segment.TOTAL_DOCS, -1);
_crc = znRecord.getLongField(CommonConstants.Segment.CRC, -1);
_creationTime = znRecord.getLongField(CommonConstants.Segment.CREATION_TIME, -1);
}
示例3: RebalanceConfig
import org.apache.helix.ZNRecord; //导入方法依赖的package包/类
/**
* Instantiate from an znRecord
*
* @param znRecord
*/
public RebalanceConfig(ZNRecord znRecord) {
_rebalanceDelay = znRecord.getLongField(RebalanceConfigProperty.REBALANCE_DELAY.name(), -1);
_rebalanceMode = znRecord
.getEnumField(RebalanceConfigProperty.REBALANCE_MODE.name(), RebalanceMode.class,
RebalanceMode.NONE);
_rebalancerClassName =
znRecord.getSimpleField(RebalanceConfigProperty.REBALANCER_CLASS_NAME.name());
_rebalanceStrategy = znRecord.getSimpleField(RebalanceConfigProperty.REBALANCE_STRATEGY.name());
_delayRebalanceDisabled =
znRecord.getBooleanField(RebalanceConfigProperty.DELAY_REBALANCE_DISABLED.name(), false);
_rebalanceTimerPeriod =
znRecord.getLongField(RebalanceConfigProperty.REBALANCE_TIMER_PERIOD.name(), -1);
}
示例4: SegmentZKMetadata
import org.apache.helix.ZNRecord; //导入方法依赖的package包/类
public SegmentZKMetadata(ZNRecord znRecord) {
_segmentName = znRecord.getSimpleField(CommonConstants.Segment.SEGMENT_NAME);
_tableName = znRecord.getSimpleField(CommonConstants.Segment.TABLE_NAME);
_segmentType = znRecord.getEnumField(CommonConstants.Segment.SEGMENT_TYPE, SegmentType.class, SegmentType.OFFLINE);
_startTime = znRecord.getLongField(CommonConstants.Segment.START_TIME, -1);
_endTime = znRecord.getLongField(CommonConstants.Segment.END_TIME, -1);
if (znRecord.getSimpleFields().containsKey(CommonConstants.Segment.TIME_UNIT) && !znRecord.getSimpleField(
CommonConstants.Segment.TIME_UNIT).equals(NULL)) {
setTimeUnit(znRecord.getEnumField(CommonConstants.Segment.TIME_UNIT, TimeUnit.class, TimeUnit.DAYS));
}
_indexVersion = znRecord.getSimpleField(CommonConstants.Segment.INDEX_VERSION);
_totalRawDocs = znRecord.getLongField(CommonConstants.Segment.TOTAL_DOCS, -1);
_crc = znRecord.getLongField(CommonConstants.Segment.CRC, -1);
_creationTime = znRecord.getLongField(CommonConstants.Segment.CREATION_TIME, -1);
try {
String partitionMetadataJson = znRecord.getSimpleField(CommonConstants.Segment.PARTITION_METADATA);
if (partitionMetadataJson != null) {
_partitionMetadata = SegmentPartitionMetadata.fromJsonString(partitionMetadataJson);
}
} catch (IOException e) {
LOGGER.error(
"Exception caught while reading partition info from zk metadata for segment '{}', partition info dropped.",
_segmentName, e);
}
_segmentUploadStartTime = znRecord.getLongField(CommonConstants.Segment.SEGMENT_UPLOAD_START_TIME, -1);
_customMap = znRecord.getMapField(CommonConstants.Segment.CUSTOM_MAP);
}