@Override public int compare( final UUID o1, final UUID o2 ) { return UUIDUtils.compare( o1, o2 ) * comparator; } }
/** Returns the minimum UUID */ public static UUID min( UUID first, UUID second ) { if ( first == null ) { if ( second == null ) { return null; } return second; } if ( second == null ) { return first; } if ( compare( first, second ) < 0 ) { return first; } return second; }
/** Returns the minimum UUID */ public static UUID max( UUID first, UUID second ) { if ( first == null ) { if ( second == null ) { return null; } return second; } if ( second == null ) { return first; } if ( compare( first, second ) < 0 ) { return second; } return first; }
column.getName(), column.getValue(), queueId, consumerId ); logger.trace( "Max timeuuid : '{}', Current timeuuid : '{}', comparison '{}'", startTimeUUID, column.getName(), UUIDUtils.compare( startTimeUUID, column.getName() ) );
if( params.startId != null && UUIDUtils.compare( params.startId, startTimeUUID ) > 0){ logger.warn( "Our cursor has advanced beyond the end of the queue due to transactions. Was {}, resetting to {}", params.startId, startTimeUUID ); params = new SearchParam( startTimeUUID, params.reversed, false, params.limit );
@Override public boolean hasMessagesInQueue( String queuePath, UUID consumerId ) { Keyspace ko = cass.getApplicationKeyspace( applicationId ); UUID queueId = CassandraMQUtils.getQueueId( queuePath ); if ( consumerId == null ) { consumerId = queueId; } NoTransactionSearch search = new NoTransactionSearch( ko ); QueueBounds bounds = search.getQueueBounds( queueId ); //Queue doesn't exist if ( bounds == null ) { return false; } UUID consumerPosition = search.getConsumerQueuePosition( queueId, consumerId ); //queue exists, but the consumer does not, meaning it's never read from the Q if ( consumerPosition == null ) { return true; } //check our consumer position against the newest message. If it's equal or larger, // we're read to the end of the queue //note that this does not take transactions into consideration, just the client pointer relative to the largest //message in the queue return UUIDUtils.compare( consumerPosition, bounds.getNewest() ) < 0; }