use of com.swirlds.common.merkle.io.MerkleDataInputStream in project hedera-services by hashgraph.
the class AccountsReader method from.
public static MerkleMap<EntityNum, MerkleAccount> from(String loc) throws Exception {
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleLong.class, MerkleLong::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(FCQueue.class, FCQueue::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleMap.class, MerkleMap::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleEntityId.class, MerkleEntityId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(EntityId.class, EntityId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleAccount.class, MerkleAccount::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleAccountState.class, MerkleAccountState::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(ExpirableTxnRecord.class, ExpirableTxnRecord::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(TxnReceipt.class, TxnReceipt::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(TxnId.class, TxnId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(CurrencyAdjustments.class, CurrencyAdjustments::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(EvmFnResult.class, EvmFnResult::new));
try (MerkleDataInputStream in = new MerkleDataInputStream(Files.newInputStream(Path.of(loc)))) {
MerkleMap<EntityNum, MerkleAccount> fcm = in.readMerkleTree(Integer.MAX_VALUE);
return fcm;
}
}
use of com.swirlds.common.merkle.io.MerkleDataInputStream in project hedera-services by hashgraph.
the class PojoFs method fromDisk.
public static PojoFs fromDisk(String dumpLoc) throws Exception {
try (MerkleDataInputStream in = new MerkleDataInputStream(Files.newInputStream(Path.of(dumpLoc)))) {
MerkleMap<String, MerkleOptionalBlob> fcm = in.readMerkleTree(Integer.MAX_VALUE);
var pojo = from(fcm);
return pojo;
}
}
use of com.swirlds.common.merkle.io.MerkleDataInputStream in project hedera-services by hashgraph.
the class PojoLedger method fromDisk.
public static PojoLedger fromDisk(String dumpLoc) throws Exception {
try (MerkleDataInputStream in = new MerkleDataInputStream(Files.newInputStream(Path.of(dumpLoc)))) {
MerkleMap<EntityNum, MerkleAccount> fcm = in.readMerkleTree(Integer.MAX_VALUE);
var pojo = from(fcm);
return pojo;
}
}
Aggregations