本文整理了Java中com.twitter.distributedlog.impl.metadata.ZKLogMetadataForWriter.getMaxTxIdData()
方法的一些代码示例,展示了ZKLogMetadataForWriter.getMaxTxIdData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKLogMetadataForWriter.getMaxTxIdData()
方法的具体详情如下:
包路径:com.twitter.distributedlog.impl.metadata.ZKLogMetadataForWriter
类名称:ZKLogMetadataForWriter
方法名:getMaxTxIdData
暂无
代码示例来源:origin: twitter/distributedlog
conf.getSanityCheckTxnID(), logMetadata.getMaxTxIdData());
代码示例来源:origin: twitter/distributedlog
DLUtils.deserializeLogSegmentSequenceNumber(logSegmentsData.getValue()));
Versioned<byte[]> maxTxIdData = logMetadata.getMaxTxIdData();
代码示例来源:origin: twitter/distributedlog
@SuppressWarnings("unchecked")
@Test(timeout = 60000)
public void testProcessLogMetadatasNoAllocatorPath() throws Exception {
String rootPath = "/test-missing-version";
URI uri = DLMTestUtil.createDLMURI(2181, rootPath);
String logName = "test-log";
String logIdentifier = "<default>";
Versioned<byte[]> maxTxnIdData =
new Versioned<byte[]>(DLUtils.serializeTransactionId(1L), new ZkVersion(1));
Versioned<byte[]> logSegmentsData =
new Versioned<byte[]>(DLUtils.serializeLogSegmentSequenceNumber(1L), new ZkVersion(1));
List<Versioned<byte[]>> metadatas = Lists.newArrayList(
new Versioned<byte[]>(null, null),
new Versioned<byte[]>(null, null),
maxTxnIdData,
new Versioned<byte[]>(ZKLogMetadataForWriter.intToBytes(ZKLogMetadata.LAYOUT_VERSION), null),
new Versioned<byte[]>(new byte[0], new ZkVersion(1)),
new Versioned<byte[]>(new byte[0], new ZkVersion(1)),
logSegmentsData);
ZKLogMetadataForWriter metadata =
ZKLogMetadataForWriter.processLogMetadatas(uri, logName, logIdentifier, metadatas, false);
assertTrue(maxTxnIdData == metadata.getMaxTxIdData());
assertTrue(logSegmentsData == metadata.getMaxLSSNData());
assertNull(metadata.getAllocationData().getValue());
assertNull(metadata.getAllocationData().getVersion());
}
代码示例来源:origin: twitter/distributedlog
@SuppressWarnings("unchecked")
@Test(timeout = 60000)
public void testProcessLogMetadatasAllocatorPath() throws Exception {
String rootPath = "/test-missing-version";
URI uri = DLMTestUtil.createDLMURI(2181, rootPath);
String logName = "test-log";
String logIdentifier = "<default>";
Versioned<byte[]> maxTxnIdData =
new Versioned<byte[]>(DLUtils.serializeTransactionId(1L), new ZkVersion(1));
Versioned<byte[]> logSegmentsData =
new Versioned<byte[]>(DLUtils.serializeLogSegmentSequenceNumber(1L), new ZkVersion(1));
Versioned<byte[]> allocationData =
new Versioned<byte[]>(DLUtils.ledgerId2Bytes(1L), new ZkVersion(1));
List<Versioned<byte[]>> metadatas = Lists.newArrayList(
new Versioned<byte[]>(null, null),
new Versioned<byte[]>(null, null),
maxTxnIdData,
new Versioned<byte[]>(ZKLogMetadataForWriter.intToBytes(ZKLogMetadata.LAYOUT_VERSION), null),
new Versioned<byte[]>(new byte[0], new ZkVersion(1)),
new Versioned<byte[]>(new byte[0], new ZkVersion(1)),
logSegmentsData,
allocationData);
ZKLogMetadataForWriter metadata =
ZKLogMetadataForWriter.processLogMetadatas(uri, logName, logIdentifier, metadatas, true);
assertTrue(maxTxnIdData == metadata.getMaxTxIdData());
assertTrue(logSegmentsData == metadata.getMaxLSSNData());
assertTrue(allocationData == metadata.getAllocationData());
}
}
内容来源于网络,如有侵权,请联系作者删除!