private void deleteFromStatsTable(List<TableRef> tableRefs, long ts) throws SQLException { boolean isAutoCommit = connection.getAutoCommit(); try { connection.setAutoCommit(true); StringBuilder buf = new StringBuilder("DELETE FROM SYSTEM.STATS WHERE PHYSICAL_NAME IN ("); for (TableRef ref : tableRefs) { buf.append("'" + ref.getTable().getPhysicalName().getString() + "',"); } buf.setCharAt(buf.length() - 1, ')'); if(tableRefs.get(0).getTable().getIndexType()==IndexType.LOCAL) { buf.append(" AND COLUMN_FAMILY IN("); if (tableRefs.get(0).getTable().getColumnFamilies().isEmpty()) { buf.append("'" + QueryConstants.DEFAULT_LOCAL_INDEX_COLUMN_FAMILY + "',"); } else { for(PColumnFamily cf : tableRefs.get(0).getTable().getColumnFamilies()) { buf.append("'" + cf.getName().getString() + "',"); } } buf.setCharAt(buf.length() - 1, ')'); } connection.createStatement().execute(buf.toString()); } finally { connection.setAutoCommit(isAutoCommit); } }
int numFunctions = functionNames.size(); List<PFunction> functionsFound = new ArrayList<PFunction>(functionNames.size()); if (updateCacheImmediately || connection.getAutoCommit()) { getFunctionFromCache(functionNames, functionsFound, true); if(functionNames.isEmpty()) {
PhoenixConnection metaConnection = new PhoenixConnection(oldMetaConnection, this, props); SQLException sqlE = null; boolean wasCommit = metaConnection.getAutoCommit(); try { metaConnection.setAutoCommit(true);
props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(timestamp)); PhoenixConnection metaConnection = new PhoenixConnection(oldMetaConnection, this, props); boolean autoCommit = metaConnection.getAutoCommit(); try { metaConnection.setAutoCommit(true);
props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(timestamp)); PhoenixConnection metaConnection = new PhoenixConnection(oldMetaConnection, this, props); boolean autoCommit = metaConnection.getAutoCommit(); try { metaConnection.setAutoCommit(true);
List<ColumnInfo> columnInfoList = buildColumnInfoList(csvParser); boolean wasAutoCommit = conn.getAutoCommit(); try { conn.setAutoCommit(false);
if (connection.getAutoCommit()) { connection.commit();
new StatementContext(new PhoenixStatement(connection), false)); } finally { if (connection.getAutoCommit()) { connection.commit();
public MutationState createFunction(CreateFunctionStatement stmt) throws SQLException { boolean wasAutoCommit = connection.getAutoCommit(); connection.rollback(); try {
private MutationState dropFunction(String functionName, boolean ifExists) throws SQLException { connection.rollback(); boolean wasAutoCommit = connection.getAutoCommit(); try { PName tenantId = connection.getTenantId();
public MutationState dropSchema(DropSchemaStatement executableDropSchemaStatement) throws SQLException { connection.rollback(); boolean wasAutoCommit = connection.getAutoCommit(); try { PSchema schema = new PSchema(executableDropSchemaStatement.getSchemaName());
tenantIdBytes = ScanUtil.getTenantIdBytes(table.getRowKeySchema(), table.getBucketNum() != null, tenantId, table.getViewIndexId() != null); final boolean isAutoCommit = connection.getAutoCommit(); ConnectionQueryServices services = connection.getQueryServices(); final int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
if (clonedConnection.getAutoCommit()) { clonedConnection.getMutationState().join(state); state = clonedConnection.getMutationState();
public MutationState dropColumn(DropColumnStatement statement) throws SQLException { connection.rollback(); boolean wasAutoCommit = connection.getAutoCommit(); try { connection.setAutoCommit(false);
public MutationState alterIndex(AlterIndexStatement statement) throws SQLException { connection.rollback(); boolean wasAutoCommit = connection.getAutoCommit(); try { String dataTableName = statement.getTableName();
public MutationState createSchema(CreateSchemaStatement create) throws SQLException { boolean wasAutoCommit = connection.getAutoCommit(); connection.rollback(); try {
boolean wasAutoCommit = connection.getAutoCommit(); PName tenantId = connection.getTenantId(); String tenantIdStr = tenantId == null ? null : tenantId.getString();
private MutationState buildIndex(PTable index, TableRef dataTableRef) throws SQLException { AlterIndexStatement indexStatement = null; boolean wasAutoCommit = connection.getAutoCommit(); try { connection.setAutoCommit(true);
return new MutationState(0, 1000, connection); boolean wasAutoCommit = connection.getAutoCommit(); try { connection.setAutoCommit(true);
QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES); int batchSize = Math.min(connection.getMutateBatchSize(), maxSize); boolean isAutoCommit = connection.getAutoCommit(); int sizeOffset = 0; int numSplColumns =