Search in sources :

Example 1 with TableNotFoundException

use of org.apache.accumulo.proxy.thrift.TableNotFoundException in project accumulo by apache.

the class SimpleProxyBase method tableNotFound.

@Test
public void tableNotFound() throws Exception {
    final String doesNotExist = "doesNotExists";
    try {
        client.addConstraint(creds, doesNotExist, NumericValueConstraint.class.getName());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.addSplits(creds, doesNotExist, Collections.<ByteBuffer>emptySet());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    final IteratorSetting setting = new IteratorSetting(100, "slow", SlowIterator.class.getName(), Collections.singletonMap("sleepTime", "200"));
    try {
        client.attachIterator(creds, doesNotExist, setting, EnumSet.allOf(IteratorScope.class));
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.cancelCompaction(creds, doesNotExist);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.checkIteratorConflicts(creds, doesNotExist, setting, EnumSet.allOf(IteratorScope.class));
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.clearLocatorCache(creds, doesNotExist);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        final String TABLE_TEST = getUniqueNames(1)[0];
        client.cloneTable(creds, doesNotExist, TABLE_TEST, false, null, null);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.compactTable(creds, doesNotExist, null, null, null, true, false, null);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.createBatchScanner(creds, doesNotExist, new BatchScanOptions());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.createScanner(creds, doesNotExist, new ScanOptions());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.createWriter(creds, doesNotExist, new WriterOptions());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.deleteRows(creds, doesNotExist, null, null);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.deleteTable(creds, doesNotExist);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.exportTable(creds, doesNotExist, "/tmp");
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.flushTable(creds, doesNotExist, null, null, false);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.getIteratorSetting(creds, doesNotExist, "foo", IteratorScope.SCAN);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.getLocalityGroups(creds, doesNotExist);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.getMaxRow(creds, doesNotExist, Collections.<ByteBuffer>emptySet(), null, false, null, false);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.getTableProperties(creds, doesNotExist);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.grantTablePermission(creds, "root", doesNotExist, TablePermission.WRITE);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.hasTablePermission(creds, "root", doesNotExist, TablePermission.WRITE);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        MiniAccumuloClusterImpl cluster = SharedMiniClusterBase.getCluster();
        Path base = cluster.getTemporaryPath();
        Path importDir = new Path(base, "importDir");
        Path failuresDir = new Path(base, "failuresDir");
        assertTrue(cluster.getFileSystem().mkdirs(importDir));
        assertTrue(cluster.getFileSystem().mkdirs(failuresDir));
        client.importDirectory(creds, doesNotExist, importDir.toString(), failuresDir.toString(), true);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.listConstraints(creds, doesNotExist);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.listSplits(creds, doesNotExist, 10000);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.mergeTablets(creds, doesNotExist, null, null);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.offlineTable(creds, doesNotExist, false);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.onlineTable(creds, doesNotExist, false);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.removeConstraint(creds, doesNotExist, 0);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.removeIterator(creds, doesNotExist, "name", EnumSet.allOf(IteratorScope.class));
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.removeTableProperty(creds, doesNotExist, Property.TABLE_FILE_MAX.getKey());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.renameTable(creds, doesNotExist, "someTableName");
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.revokeTablePermission(creds, "root", doesNotExist, TablePermission.ALTER_TABLE);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.setTableProperty(creds, doesNotExist, Property.TABLE_FILE_MAX.getKey(), "0");
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.splitRangeByTablets(creds, doesNotExist, client.getRowRange(ByteBuffer.wrap("row".getBytes(UTF_8))), 10);
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.updateAndFlush(creds, doesNotExist, new HashMap<ByteBuffer, List<ColumnUpdate>>());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.getDiskUsage(creds, Collections.singleton(doesNotExist));
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.testTableClassLoad(creds, doesNotExist, VersioningIterator.class.getName(), SortedKeyValueIterator.class.getName());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
    try {
        client.createConditionalWriter(creds, doesNotExist, new ConditionalWriterOptions());
        fail("exception not thrown");
    } catch (TableNotFoundException ex) {
    }
}
Also used : Path(org.apache.hadoop.fs.Path) BatchScanOptions(org.apache.accumulo.proxy.thrift.BatchScanOptions) SortedKeyValueIterator(org.apache.accumulo.core.iterators.SortedKeyValueIterator) ByteBuffer(java.nio.ByteBuffer) TableNotFoundException(org.apache.accumulo.proxy.thrift.TableNotFoundException) IteratorSetting(org.apache.accumulo.proxy.thrift.IteratorSetting) ConditionalWriterOptions(org.apache.accumulo.proxy.thrift.ConditionalWriterOptions) ConditionalWriterOptions(org.apache.accumulo.proxy.thrift.ConditionalWriterOptions) WriterOptions(org.apache.accumulo.proxy.thrift.WriterOptions) ScanOptions(org.apache.accumulo.proxy.thrift.ScanOptions) BatchScanOptions(org.apache.accumulo.proxy.thrift.BatchScanOptions) ArrayList(java.util.ArrayList) List(java.util.List) IteratorScope(org.apache.accumulo.proxy.thrift.IteratorScope) VersioningIterator(org.apache.accumulo.core.iterators.user.VersioningIterator) NumericValueConstraint(org.apache.accumulo.test.constraints.NumericValueConstraint) MiniAccumuloClusterImpl(org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl) SlowIterator(org.apache.accumulo.test.functional.SlowIterator) Test(org.junit.Test)

Aggregations

ByteBuffer (java.nio.ByteBuffer)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 SortedKeyValueIterator (org.apache.accumulo.core.iterators.SortedKeyValueIterator)1 VersioningIterator (org.apache.accumulo.core.iterators.user.VersioningIterator)1 MiniAccumuloClusterImpl (org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl)1 BatchScanOptions (org.apache.accumulo.proxy.thrift.BatchScanOptions)1 ConditionalWriterOptions (org.apache.accumulo.proxy.thrift.ConditionalWriterOptions)1 IteratorScope (org.apache.accumulo.proxy.thrift.IteratorScope)1 IteratorSetting (org.apache.accumulo.proxy.thrift.IteratorSetting)1 ScanOptions (org.apache.accumulo.proxy.thrift.ScanOptions)1 TableNotFoundException (org.apache.accumulo.proxy.thrift.TableNotFoundException)1 WriterOptions (org.apache.accumulo.proxy.thrift.WriterOptions)1 NumericValueConstraint (org.apache.accumulo.test.constraints.NumericValueConstraint)1 SlowIterator (org.apache.accumulo.test.functional.SlowIterator)1 Path (org.apache.hadoop.fs.Path)1 Test (org.junit.Test)1