public RecordLocation getNextRecordLocation()

in activeio-core/src/main/java/org/apache/activeio/journal/howl/HowlJournal.java [156:182]


	public RecordLocation getNextRecordLocation(RecordLocation lastLocation)
			throws InvalidRecordLocationException {
	    
	    if( lastLocation ==null ) {
	        if( this.lastMark !=null ) {
	            lastLocation = lastMark;
	        } else {
	            return null;
	        }
	    }
	    
	    try {
	        while(true) {
	            LogRecord record = logger.get(null, toLong(lastLocation));
		        // I assume getNext will return null if there is no next record. 
	            LogRecord next = logger.getNext(record);
	            if( next==null || next.length == 0 )
	                return null;
	            lastLocation = new LongRecordLocation(next.key);
	            if( !next.isCTRL() )
	                return lastLocation;
	        }
		} catch (Exception e) {
			throw (InvalidRecordLocationException)new InvalidRecordLocationException().initCause(e);
        }
		
	}