@Override public IndexerDefinition getIndexer(String name) throws IndexerNotFoundException { IndexerDefinition index = indexers.get(name); if (index == null) { throw new IndexerNotFoundException(name); } return index; }
@Override public IndexerDefinition getIndexer(String name) throws IndexerNotFoundException { IndexerDefinition index = indexers.get(name); if (index == null) { throw new IndexerNotFoundException(name); } return index; }
@Override public void updateIndexerInternal(final IndexerDefinition indexer) throws InterruptedException, KeeperException, IndexerNotFoundException, IndexerConcurrentModificationException, IndexerValidityException { assertValid(indexer); final byte[] newData = IndexerDefinitionJsonSerDeser.INSTANCE.toJsonBytes(indexer); try { zk.retryOperation(new ZooKeeperOperation<Stat>() { @Override public Stat execute() throws KeeperException, InterruptedException { return zk.setData(indexerCollectionPathSlash + indexer.getName(), newData, indexer.getOccVersion()); } }); } catch (KeeperException.NoNodeException e) { throw new IndexerNotFoundException(indexer.getName()); } catch (KeeperException.BadVersionException e) { throw new IndexerConcurrentModificationException(indexer.getName()); } }
private IndexerDefinition loadIndexer(String indexerName, boolean forCache) throws InterruptedException, KeeperException, IndexerNotFoundException { final String childPath = indexerCollectionPath + "/" + indexerName; final Stat stat = new Stat(); byte[] data; try { if (forCache) { // do not retry, install watcher data = zk.getData(childPath, watcher, stat); } else { // do retry, do not install watcher data = zk.retryOperation(new ZooKeeperOperation<byte[]>() { @Override public byte[] execute() throws KeeperException, InterruptedException { return zk.getData(childPath, false, stat); } }); } } catch (KeeperException.NoNodeException e) { throw new IndexerNotFoundException(indexerName); } IndexerDefinitionBuilder builder = IndexerDefinitionJsonSerDeser.INSTANCE.fromJsonBytes(data); builder.name(indexerName); builder.occVersion(stat.getVersion()); return builder.build(); }
private IndexerDefinition loadIndexer(String indexerName, boolean forCache) throws InterruptedException, KeeperException, IndexerNotFoundException { final String childPath = indexerCollectionPath + "/" + indexerName; final Stat stat = new Stat(); byte[] data; try { if (forCache) { // do not retry, install watcher data = zk.getData(childPath, watcher, stat); } else { // do retry, do not install watcher data = zk.retryOperation(new ZooKeeperOperation<byte[]>() { @Override public byte[] execute() throws KeeperException, InterruptedException { return zk.getData(childPath, false, stat); } }); } } catch (KeeperException.NoNodeException e) { throw new IndexerNotFoundException(indexerName); } IndexerDefinitionBuilder builder = IndexerDefinitionJsonSerDeser.INSTANCE.fromJsonBytes(data); builder.name(indexerName); builder.occVersion(stat.getVersion()); return builder.build(); }
@Override public void updateIndexerInternal(final IndexerDefinition indexer) throws InterruptedException, KeeperException, IndexerNotFoundException, IndexerConcurrentModificationException, IndexerValidityException { assertValid(indexer); final byte[] newData = IndexerDefinitionJsonSerDeser.INSTANCE.toJsonBytes(indexer); try { zk.retryOperation(new ZooKeeperOperation<Stat>() { @Override public Stat execute() throws KeeperException, InterruptedException { return zk.setData(indexerCollectionPathSlash + indexer.getName(), newData, indexer.getOccVersion()); } }); } catch (KeeperException.NoNodeException e) { throw new IndexerNotFoundException(indexer.getName()); } catch (KeeperException.BadVersionException e) { throw new IndexerConcurrentModificationException(indexer.getName()); } }
if (!getModel().hasIndexer(indexerName)) { throw new IndexerServerException(HttpServletResponse.SC_BAD_REQUEST, new IndexerNotFoundException("Indexer does not exist: " + indexerName));
new IndexerNotFoundException("Indexer does not exist: " + indexName));
throw new IndexerNotFoundException(indexerName);
throw new IndexerNotFoundException(indexerName);