/** * Fetch the rootPage of a given B-tree for a given revision. * * @param btree The B-tree we are interested in * @param revision The revision we want to get back * @return The rootPage for this B-tree and this revision, if any * @throws KeyNotFoundException If we can't find the rootPage for this revision and this B-tree * @throws IOException If we had an ise while accessing the data on disk */ /* No qualifier */<K, V> Page<K, V> getRootPage( BTree<K, V> btree, long revision ) throws KeyNotFoundException, IOException { if ( btree.getRevision() == revision ) { // We are asking for the current revision return btree.getRootPage(); } // Get the B-tree header offset NameRevision nameRevision = new NameRevision( btree.getName(), revision ); long btreeHeaderOffset = btreeOfBtrees.get( nameRevision ); // get the B-tree rootPage Page<K, V> btreeRoot = readRootPage( btree, btreeHeaderOffset ); return btreeRoot; }
/** * {@inheritDoc} */ @Override protected KrbIdentity doGetIdentity(String principalName) throws KrbException { try { return database.get(principalName); } catch (KeyNotFoundException e) { LOG.debug("Identity {} doesn't exist", principalName); return null; } catch (IOException e) { throw new KrbException("Failed to get the identity " + principalName); } }
V val = bt.get( key );
V val = bt.get( key );
/** * {@inheritDoc} */ @Override public V get( PartitionTxn transaction, K key ) throws LdapException { if ( key == null ) { return null; } try { return bt.get( key ); } catch ( KeyNotFoundException knfe ) { return null; } catch ( Exception e ) { throw new LdapException( e ); } }