當前位置: 首頁>>代碼示例>>Java>>正文


Java Serializer.readObjectNotNull方法代碼示例

本文整理匯總了Java中com.thinkaurelius.titan.graphdb.database.serialize.Serializer.readObjectNotNull方法的典型用法代碼示例。如果您正苦於以下問題:Java Serializer.readObjectNotNull方法的具體用法?Java Serializer.readObjectNotNull怎麽用?Java Serializer.readObjectNotNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.thinkaurelius.titan.graphdb.database.serialize.Serializer的用法示例。


在下文中一共展示了Serializer.readObjectNotNull方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parse

import com.thinkaurelius.titan.graphdb.database.serialize.Serializer; //導入方法依賴的package包/類
public static Entry parse(StaticBuffer buffer, Serializer serializer, TimestampProvider times) {
    ReadBuffer read = buffer.asReadBuffer();
    Instant txTimestamp = times.getTime(read.getLong());
    TransactionLogHeader header = new TransactionLogHeader(VariableLong.readPositive(read),
            txTimestamp, times);
    LogTxStatus status = serializer.readObjectNotNull(read,LogTxStatus.class);
    EnumMap<LogTxMeta,Object> metadata = new EnumMap<LogTxMeta, Object>(LogTxMeta.class);
    int metaSize = VariableLong.unsignedByte(read.getByte());
    for (int i=0;i<metaSize;i++) {
        LogTxMeta meta = LogTxMeta.values()[VariableLong.unsignedByte(read.getByte())];
        metadata.put(meta,serializer.readObjectNotNull(read,meta.dataType()));
    }
    if (read.hasRemaining()) {
        StaticBuffer content = read.subrange(read.getPosition(),read.length()-read.getPosition());
        return new Entry(header,content, status,metadata);
    } else {
        return new Entry(header,null, status,metadata);
    }
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:20,代碼來源:TransactionLogHeader.java

示例2: parse

import com.thinkaurelius.titan.graphdb.database.serialize.Serializer; //導入方法依賴的package包/類
public static Entry parse(StaticBuffer buffer, Serializer serializer, TimestampProvider times) {
    ReadBuffer read = buffer.asReadBuffer();
    Timepoint txTimestamp = new StandardTimepoint(read.getLong(), times);
    TransactionLogHeader header = new TransactionLogHeader(VariableLong.readPositive(read),
            txTimestamp);
    LogTxStatus status = serializer.readObjectNotNull(read,LogTxStatus.class);
    EnumMap<LogTxMeta,Object> metadata = new EnumMap<LogTxMeta, Object>(LogTxMeta.class);
    int metaSize = VariableLong.unsignedByte(read.getByte());
    for (int i=0;i<metaSize;i++) {
        LogTxMeta meta = LogTxMeta.values()[VariableLong.unsignedByte(read.getByte())];
        metadata.put(meta,serializer.readObjectNotNull(read,meta.dataType()));
    }
    if (read.hasRemaining()) {
        StaticBuffer content = read.subrange(read.getPosition(),read.length()-read.getPosition());
        return new Entry(header,content, status,metadata);
    } else {
        return new Entry(header,null, status,metadata);
    }
}
 
開發者ID:graben1437,項目名稱:titan0.5.4-hbase1.1.1-custom,代碼行數:20,代碼來源:TransactionLogHeader.java


注:本文中的com.thinkaurelius.titan.graphdb.database.serialize.Serializer.readObjectNotNull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。