public boolean isHead() { return getPageId() == containingList.getHeadPageId(); }
protected ListNode<Key,Value> getHead(Transaction tx) throws IOException { return loadNode(tx, getHeadPageId()); }
@Override public void writePayload(StoredDestination value, DataOutput dataOut) throws IOException { dataOut.writeLong(value.orderIndex.defaultPriorityIndex.getPageId()); dataOut.writeLong(value.locationIndex.getPageId()); dataOut.writeLong(value.messageIdIndex.getPageId()); if (value.subscriptions != null) { dataOut.writeBoolean(true); dataOut.writeLong(value.subscriptions.getPageId()); dataOut.writeLong(value.subscriptionAcks.getPageId()); dataOut.writeLong(value.ackPositions.getHeadPageId()); dataOut.writeLong(value.subLocations.getHeadPageId()); } else { dataOut.writeBoolean(false); } dataOut.writeLong(value.orderIndex.lowPriorityIndex.getPageId()); dataOut.writeLong(value.orderIndex.highPriorityIndex.getPageId()); dataOut.writeLong(value.messageStoreStatistics.getPageId()); } }
final Page<ListNode<Key,Value>> p = tx.load(getHeadPageId(), null); if( p.getType() == Page.PAGE_FREE_TYPE ) { storeNode(tx, root, true); setHeadPageId(p.getPageId()); setTailPageId(getHeadPageId()); } else { ListNode<Key, Value> node = loadNode(tx, getHeadPageId()); setTailPageId(getHeadPageId()); size.addAndGet(node.size(tx)); onLoad(node, tx);
tx.free(sd.ackPositions.getHeadPageId()); tx.free(sd.subLocations.getHeadPageId());
public boolean isHead() { return getPageId() == containingList.getHeadPageId(); }
public boolean isHead() { return getPageId() == containingList.getHeadPageId(); }
protected ListNode<Key,Value> getHead(Transaction tx) throws IOException { return loadNode(tx, getHeadPageId()); }
protected ListNode<Key,Value> getHead(Transaction tx) throws IOException { return loadNode(tx, getHeadPageId()); }
protected ListNode<Key,Value> getHead(Transaction tx) throws IOException { return loadNode(tx, getHeadPageId()); }
public boolean isHead() { return getPageId() == containingList.getHeadPageId(); }
@Override public void writePayload(StoredDestination value, DataOutput dataOut) throws IOException { dataOut.writeLong(value.orderIndex.defaultPriorityIndex.getPageId()); dataOut.writeLong(value.locationIndex.getPageId()); dataOut.writeLong(value.messageIdIndex.getPageId()); if (value.subscriptions != null) { dataOut.writeBoolean(true); dataOut.writeLong(value.subscriptions.getPageId()); dataOut.writeLong(value.subscriptionAcks.getPageId()); dataOut.writeLong(value.ackPositions.getHeadPageId()); dataOut.writeLong(value.subLocations.getHeadPageId()); } else { dataOut.writeBoolean(false); } dataOut.writeLong(value.orderIndex.lowPriorityIndex.getPageId()); dataOut.writeLong(value.orderIndex.highPriorityIndex.getPageId()); } }
@Override public void writePayload(StoredDestination value, DataOutput dataOut) throws IOException { dataOut.writeLong(value.orderIndex.defaultPriorityIndex.getPageId()); dataOut.writeLong(value.locationIndex.getPageId()); dataOut.writeLong(value.messageIdIndex.getPageId()); if (value.subscriptions != null) { dataOut.writeBoolean(true); dataOut.writeLong(value.subscriptions.getPageId()); dataOut.writeLong(value.subscriptionAcks.getPageId()); dataOut.writeLong(value.ackPositions.getHeadPageId()); dataOut.writeLong(value.subLocations.getHeadPageId()); } else { dataOut.writeBoolean(false); } dataOut.writeLong(value.orderIndex.lowPriorityIndex.getPageId()); dataOut.writeLong(value.orderIndex.highPriorityIndex.getPageId()); } }
@Override public void writePayload(StoredDestination value, DataOutput dataOut) throws IOException { dataOut.writeLong(value.orderIndex.defaultPriorityIndex.getPageId()); dataOut.writeLong(value.locationIndex.getPageId()); dataOut.writeLong(value.messageIdIndex.getPageId()); if (value.subscriptions != null) { dataOut.writeBoolean(true); dataOut.writeLong(value.subscriptions.getPageId()); dataOut.writeLong(value.subscriptionAcks.getPageId()); dataOut.writeLong(value.ackPositions.getHeadPageId()); dataOut.writeLong(value.subLocations.getHeadPageId()); } else { dataOut.writeBoolean(false); } dataOut.writeLong(value.orderIndex.lowPriorityIndex.getPageId()); dataOut.writeLong(value.orderIndex.highPriorityIndex.getPageId()); } }
final Page<ListNode<Key,Value>> p = tx.load(getHeadPageId(), null); if( p.getType() == Page.PAGE_FREE_TYPE ) { storeNode(tx, root, true); setHeadPageId(p.getPageId()); setTailPageId(getHeadPageId()); } else { ListNode<Key, Value> node = loadNode(tx, getHeadPageId()); setTailPageId(getHeadPageId()); size.addAndGet(node.size(tx)); onLoad(node, tx);
final Page<ListNode<Key,Value>> p = tx.load(getHeadPageId(), null); if( p.getType() == Page.PAGE_FREE_TYPE ) { storeNode(tx, root, true); setHeadPageId(p.getPageId()); setTailPageId(getHeadPageId()); } else { ListNode<Key, Value> node = loadNode(tx, getHeadPageId()); setTailPageId(getHeadPageId()); size.addAndGet(node.size(tx)); onLoad(node, tx);
final Page<ListNode<Key,Value>> p = tx.load(getHeadPageId(), null); if( p.getType() == Page.PAGE_FREE_TYPE ) { storeNode(tx, root, true); setHeadPageId(p.getPageId()); setTailPageId(getHeadPageId()); } else { ListNode<Key, Value> node = loadNode(tx, getHeadPageId()); setTailPageId(getHeadPageId()); size.addAndGet(node.size(tx)); onLoad(node, tx);
void updateIndex(Transaction tx, KahaRemoveDestinationCommand command, Location location) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); sd.orderIndex.remove(tx); sd.locationIndex.clear(tx); sd.locationIndex.unload(tx); tx.free(sd.locationIndex.getPageId()); sd.messageIdIndex.clear(tx); sd.messageIdIndex.unload(tx); tx.free(sd.messageIdIndex.getPageId()); if (sd.subscriptions != null) { sd.subscriptions.clear(tx); sd.subscriptions.unload(tx); tx.free(sd.subscriptions.getPageId()); sd.subscriptionAcks.clear(tx); sd.subscriptionAcks.unload(tx); tx.free(sd.subscriptionAcks.getPageId()); sd.ackPositions.clear(tx); sd.ackPositions.unload(tx); tx.free(sd.ackPositions.getHeadPageId()); sd.subLocations.clear(tx); sd.subLocations.unload(tx); tx.free(sd.subLocations.getHeadPageId()); } String key = key(command.getDestination()); storedDestinations.remove(key); metadata.destinations.remove(tx, key); clearStoreStats(command.getDestination()); storeCache.remove(key(command.getDestination())); }
void updateIndex(Transaction tx, KahaRemoveDestinationCommand command, Location location) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); sd.orderIndex.remove(tx); sd.locationIndex.clear(tx); sd.locationIndex.unload(tx); tx.free(sd.locationIndex.getPageId()); sd.messageIdIndex.clear(tx); sd.messageIdIndex.unload(tx); tx.free(sd.messageIdIndex.getPageId()); if (sd.subscriptions != null) { sd.subscriptions.clear(tx); sd.subscriptions.unload(tx); tx.free(sd.subscriptions.getPageId()); sd.subscriptionAcks.clear(tx); sd.subscriptionAcks.unload(tx); tx.free(sd.subscriptionAcks.getPageId()); sd.ackPositions.clear(tx); sd.ackPositions.unload(tx); tx.free(sd.ackPositions.getHeadPageId()); sd.subLocations.clear(tx); sd.subLocations.unload(tx); tx.free(sd.subLocations.getHeadPageId()); } String key = key(command.getDestination()); storedDestinations.remove(key); metadata.destinations.remove(tx, key); clearStoreStats(command.getDestination()); storeCache.remove(key(command.getDestination())); }
void updateIndex(Transaction tx, KahaRemoveDestinationCommand command, Location location) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); sd.orderIndex.remove(tx); sd.locationIndex.clear(tx); sd.locationIndex.unload(tx); tx.free(sd.locationIndex.getPageId()); sd.messageIdIndex.clear(tx); sd.messageIdIndex.unload(tx); tx.free(sd.messageIdIndex.getPageId()); if (sd.subscriptions != null) { sd.subscriptions.clear(tx); sd.subscriptions.unload(tx); tx.free(sd.subscriptions.getPageId()); sd.subscriptionAcks.clear(tx); sd.subscriptionAcks.unload(tx); tx.free(sd.subscriptionAcks.getPageId()); sd.ackPositions.clear(tx); sd.ackPositions.unload(tx); tx.free(sd.ackPositions.getHeadPageId()); sd.subLocations.clear(tx); sd.subLocations.unload(tx); tx.free(sd.subLocations.getHeadPageId()); } String key = key(command.getDestination()); storedDestinations.remove(key); metadata.destinations.remove(tx, key); clearStoreStats(command.getDestination()); storeCache.remove(key(command.getDestination())); }