@Override public long createSequence(String tenantId, String schemaName, String sequenceName, long startWith, long incrementBy, int cacheSize, long timestamp) throws SQLException { SequenceKey sequenceKey = new SequenceKey(tenantId, schemaName, sequenceName); Sequence newSequences = new Sequence(sequenceKey); Sequence sequence = sequenceMap.putIfAbsent(sequenceKey, newSequences); if (sequence == null) { sequence = newSequences; } try { sequence.getLock().lock(); // Now that we have the lock we need, create the sequence Append append = sequence.createSequence(startWith, incrementBy, cacheSize, timestamp); HTableInterface htable = this.getTable(PhoenixDatabaseMetaData.SEQUENCE_TABLE_NAME_BYTES); try { Result result = htable.append(append); return sequence.createSequence(result); } catch (IOException e) { throw ServerUtil.parseServerException(e); } } finally { sequence.getLock().unlock(); } }
@Override public long dropSequence(String tenantId, String schemaName, String sequenceName, long timestamp) throws SQLException { SequenceKey sequenceKey = new SequenceKey(tenantId, schemaName, sequenceName); Sequence newSequences = new Sequence(sequenceKey); Sequence sequence = sequenceMap.putIfAbsent(sequenceKey, newSequences); if (sequence == null) { sequence = newSequences; } try { sequence.getLock().lock(); // Now that we have the lock we need, create the sequence Append append = sequence.dropSequence(timestamp); HTableInterface htable = this.getTable(PhoenixDatabaseMetaData.SEQUENCE_TABLE_NAME_BYTES); try { Result result = htable.append(append); return sequence.dropSequence(result); } catch (IOException e) { throw ServerUtil.parseServerException(e); } } finally { sequence.getLock().unlock(); } }
@Override public Result run(HTableInterface table) throws IOException, InterruptedException { return table.append(append); } });
@Override public Result append(Append append) throws IOException { return table.append(append); }
@Override public Result append(Append append) throws IOException { return table.append(append); }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { if (allowNonTransactional) { return hTable.append(append); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public Result append(Append append) throws IOException { checkState(); return table.append(append); }
@Override public Result append(Append append) throws IOException { addAuthInfo(append); return delegate.append(append); }