/** Insert a tuple - return true if it was really added, false if it was a duplicate */ public boolean add(Tuple<NodeId> t) { if ( tupleLen != t.len() ) throw new TDBException(format("Mismatch: inserting tuple of length %d into a table of tuples of length %d", t.len(), tupleLen)) ; for ( int i = 0 ; i < indexes.length ; i++ ) { if ( indexes[i] == null ) continue ; if ( ! indexes[i].add(t) ) { if ( i == 0 ) { duplicate(t) ; return false ; } unexpectedDuplicate(t, i) ; throw new TDBException(format("Secondary index duplicate: %s -> %s",indexes[i].getMapping(), t)) ; } syncNeeded = true ; } return true ; }