public static void readForRedo(ByteBuffer buff, Map<String, List<ByteBuffer>> pendingRedoLog) { String mapName = ValueString.type.read(buff); List<ByteBuffer> keyValues = pendingRedoLog.get(mapName); if (keyValues == null) { keyValues = new ArrayList<>(); pendingRedoLog.put(mapName, keyValues); } int len = buff.getInt(); byte[] keyValue = new byte[len]; buff.get(keyValue); keyValues.add(ByteBuffer.wrap(keyValue)); }
static List<String> readReplicationHostIds(ByteBuffer buff) { int length = buff.getInt(); List<String> replicationHostIds = new ArrayList<>(length); for (int i = 0; i < length; i++) replicationHostIds.add(ValueString.type.read(buff)); if (replicationHostIds.isEmpty()) replicationHostIds = null; return replicationHostIds; }
Object obj; if (ct == -1) { String componentType = ValueString.type.read(buff); try { clazz = Class.forName(componentType);
@Override public void replicateRootPages(String dbName, ByteBuffer rootPages) { Database database = LealoneDatabase.getInstance().getDatabase(dbName); if (!database.isInitialized()) { database.init(); } int size = rootPages.getInt(); for (int i = 0; i < size; i++) { String mapName = ValueString.type.read(rootPages); StorageMap<?, ?> map = database.getStorageMap(mapName); map.setRootPage(rootPages); if (i == 0) { database = database.copy(); } } }
public static RedoLogRecord read(ByteBuffer buff) { String mapName = ValueString.type.read(buff); return new DroppedMapRedoLogRecord(mapName); } }
public static DistributedTransactionRedoLogRecord read(ByteBuffer buff) { long transactionId = DataUtils.readVarLong(buff); ByteBuffer operations = readOperations(buff); String transactionName = ValueString.type.read(buff); String allLocalTransactionNames = ValueString.type.read(buff); long commitTimestamp = DataUtils.readVarLong(buff); return new DistributedTransactionRedoLogRecord(transactionId, transactionName, allLocalTransactionNames, commitTimestamp, operations); } }