public Location getNextLocation(Location location) throws IOException, IllegalStateException { return getNextLocation(location, null); }
private Location getNextLocationForAckForward(final Location nextLocation, final Location limit) { //getNextLocation() can throw an IOException, we should handle it and set //nextLocation to null and abort gracefully //Should not happen in the normal case Location location = null; try { location = journal.getNextLocation(nextLocation, limit); } catch (IOException e) { LOG.warn("Failed to load next journal location after: {}, reason: {}", nextLocation, e); if (LOG.isDebugEnabled()) { LOG.debug("Failed to load next journal location after: {}", nextLocation, e); } } return location; }
private Location getNextInitializedLocation(Location location) throws IOException { Location mayNotBeInitialized = journal.getNextLocation(location); if (location.getSize() == NOT_SET && mayNotBeInitialized != null && mayNotBeInitialized.getSize() != NOT_SET) { // need to init size and type to skip return journal.getNextLocation(mayNotBeInitialized); } else { return mayNotBeInitialized; } }
private void recoverPendingLocalTransactions() throws IOException { Location location = journal.getNextLocation(null); while (location != null) { process(load(location)); location = journal.getNextLocation(location); } recoveredPendingCommit.addAll(inflightTransactions.keySet()); LOG.info("pending local transactions: " + recoveredPendingCommit); }
private Location getRecoveryPosition() throws IOException { if (!this.forceRecoverIndex) { // If we need to recover the transactions.. if (metadata.firstInProgressTransactionLocation != null) { return metadata.firstInProgressTransactionLocation; } // Perhaps there were no transactions... if( metadata.lastUpdate!=null) { // Start replay at the record after the last one recorded in the index file. return getNextInitializedLocation(metadata.lastUpdate); } } // This loads the first position. return journal.getNextLocation(null); }
public void incrementalRecover() throws IOException { this.indexLock.writeLock().lock(); try { if( nextRecoveryPosition == null ) { if( lastRecoveryPosition==null ) { nextRecoveryPosition = getRecoveryPosition(); } else { nextRecoveryPosition = journal.getNextLocation(lastRecoveryPosition); } } while (nextRecoveryPosition != null) { lastRecoveryPosition = nextRecoveryPosition; metadata.lastUpdate = lastRecoveryPosition; JournalCommand<?> message = load(lastRecoveryPosition); process(message, lastRecoveryPosition, (IndexAware) null); nextRecoveryPosition = journal.getNextLocation(lastRecoveryPosition); } } finally { this.indexLock.writeLock().unlock(); } }
private Location getRecoveryPosition() throws IOException { // This loads the first position and we completely rebuild the index if we // do not override it with some known recovery start location. Location result = null; if (!isForceRecoverIndex()) { if (metaData.getLastUpdateLocation() != null) { result = metaData.getLastUpdateLocation(); } } return journal.getNextLocation(result); }
recoveryPosition = journal.getNextLocation(recoveryPosition); if (LOG.isInfoEnabled() && redoCounter % 100000 == 0) { LOG.info("@ {}, {} entries recovered ..", recoveryPosition, redoCounter);
requiresJournalReplay |= recoverAckMessageFileMap(); Location lastIndoubtPosition = getRecoveryPosition(); Location recoveryPosition = requiresJournalReplay ? journal.getNextLocation(null) : lastIndoubtPosition; if (recoveryPosition != null) { int redoCounter = 0; recoveryPosition = journal.getNextLocation(recoveryPosition);
public Location getNextLocation(Location location) throws IOException, IllegalStateException { return getNextLocation(location, null); }
public Location getNextLocation(Location location) throws IOException, IllegalStateException { return getNextLocation(location, null); }
private Location getNextInitializedLocation(Location location) throws IOException { Location mayNotBeInitialized = journal.getNextLocation(location); if (location.getSize() == NOT_SET && mayNotBeInitialized != null && mayNotBeInitialized.getSize() != NOT_SET) { // need to init size and type to skip return journal.getNextLocation(mayNotBeInitialized); } else { return mayNotBeInitialized; } }
private void recoverPendingLocalTransactions() throws IOException { Location location = journal.getNextLocation(null); while (location != null) { process(load(location)); location = journal.getNextLocation(location); } recoveredPendingCommit.addAll(inflightTransactions.keySet()); LOG.info("pending local transactions: " + recoveredPendingCommit); }
private void recoverPendingLocalTransactions() throws IOException { Location location = journal.getNextLocation(null); while (location != null) { process(load(location)); location = journal.getNextLocation(location); } recoveredPendingCommit.addAll(inflightTransactions.keySet()); LOG.info("pending local transactions: " + recoveredPendingCommit); }
private void recoverPendingLocalTransactions() throws IOException { Location location = journal.getNextLocation(null); while (location != null) { process(load(location)); location = journal.getNextLocation(location); } recoveredPendingCommit.addAll(inflightTransactions.keySet()); LOG.info("pending local transactions: " + recoveredPendingCommit); }
private Location getNextInitializedLocation(Location location) throws IOException { Location mayNotBeInitialized = journal.getNextLocation(location); if (location.getSize() == NOT_SET && mayNotBeInitialized != null && mayNotBeInitialized.getSize() != NOT_SET) { // need to init size and type to skip return journal.getNextLocation(mayNotBeInitialized); } else { return mayNotBeInitialized; } }
private Location getNextInitializedLocation(Location location) throws IOException { Location mayNotBeInitialized = journal.getNextLocation(location); if (location.getSize() == NOT_SET && mayNotBeInitialized != null && mayNotBeInitialized.getSize() != NOT_SET) { // need to init size and type to skip return journal.getNextLocation(mayNotBeInitialized); } else { return mayNotBeInitialized; } }
private Location getRecoveryPosition() throws IOException { // This loads the first position and we completely rebuild the index if we // do not override it with some known recovery start location. Location result = null; if (!isForceRecoverIndex()) { if (metaData.getLastUpdateLocation() != null) { result = metaData.getLastUpdateLocation(); } } return journal.getNextLocation(result); }
private Location getRecoveryPosition() throws IOException { // This loads the first position and we completely rebuild the index if we // do not override it with some known recovery start location. Location result = null; if (!isForceRecoverIndex()) { if (metaData.getLastUpdateLocation() != null) { result = metaData.getLastUpdateLocation(); } } return journal.getNextLocation(result); }
private Location getRecoveryPosition() throws IOException { // This loads the first position and we completely rebuild the index if we // do not override it with some known recovery start location. Location result = null; if (!isForceRecoverIndex()) { if (metaData.getLastUpdateLocation() != null) { result = metaData.getLastUpdateLocation(); } } return journal.getNextLocation(result); }