public static void setIndexRemoved(String keyspaceName, String indexName) { String req = "DELETE FROM %s.\"%s\" WHERE table_name = ? AND index_name = ?"; executeInternal(String.format(req, SchemaConstants.SYSTEM_KEYSPACE_NAME, BUILT_INDEXES), keyspaceName, indexName); forceBlockingFlush(BUILT_INDEXES); }
public static void setViewBuilt(String keyspaceName, String viewName, boolean replicated) { String req = "INSERT INTO %s.\"%s\" (keyspace_name, view_name, status_replicated) VALUES (?, ?, ?)"; executeInternal(String.format(req, SchemaConstants.SYSTEM_KEYSPACE_NAME, BUILT_VIEWS), keyspaceName, viewName, replicated); forceBlockingFlush(BUILT_VIEWS); }
/** * This method is used to remove information about truncation time for specified column family */ public static synchronized void removeTruncationRecord(UUID cfId) { String req = "DELETE truncated_at[?] from system.%s WHERE key = '%s'"; executeInternal(String.format(req, LOCAL, LOCAL), cfId); truncationRecords = null; forceBlockingFlush(LOCAL); }
public static void setViewRemoved(String keyspaceName, String viewName) { String buildReq = "DELETE FROM %S.%s WHERE keyspace_name = ? AND view_name = ?"; executeInternal(String.format(buildReq, SchemaConstants.SYSTEM_KEYSPACE_NAME, VIEWS_BUILDS_IN_PROGRESS), keyspaceName, viewName); forceBlockingFlush(VIEWS_BUILDS_IN_PROGRESS); String builtReq = "DELETE FROM %s.\"%s\" WHERE keyspace_name = ? AND view_name = ?"; executeInternal(String.format(builtReq, SchemaConstants.SYSTEM_KEYSPACE_NAME, BUILT_VIEWS), keyspaceName, viewName); forceBlockingFlush(BUILT_VIEWS); }
public static void setIndexRemoved(String keyspaceName, String indexName) { String req = "DELETE FROM %s.\"%s\" WHERE table_name = ? AND index_name = ?"; executeInternal(String.format(req, SchemaConstants.SYSTEM_KEYSPACE_NAME, BUILT_INDEXES), keyspaceName, indexName); forceBlockingFlush(BUILT_INDEXES); }
public static void updatePreferredIP(InetAddress ep, InetAddress preferred_ip) { String req = "INSERT INTO system.%s (peer, preferred_ip) VALUES (?, ?)"; executeInternal(String.format(req, PEERS), ep, preferred_ip); forceBlockingFlush(PEERS); }
public static void setViewBuilt(String keyspaceName, String viewName, boolean replicated) { String req = "INSERT INTO %s.\"%s\" (keyspace_name, view_name, status_replicated) VALUES (?, ?, ?)"; executeInternal(String.format(req, SchemaConstants.SYSTEM_KEYSPACE_NAME, BUILT_VIEWS), keyspaceName, viewName, replicated); forceBlockingFlush(BUILT_VIEWS); }
/** * Remove stored tokens being used by another node */ public static void removeEndpoint(InetAddress ep) { String req = "DELETE FROM system.%s WHERE peer = ?"; executeInternal(String.format(req, PEERS), ep); forceBlockingFlush(PEERS); }
public static void setIndexBuilt(String keyspaceName, String indexName) { String req = "INSERT INTO %s.\"%s\" (table_name, index_name) VALUES (?, ?)"; executeInternal(String.format(req, SchemaConstants.SYSTEM_KEYSPACE_NAME, BUILT_INDEXES), keyspaceName, indexName); forceBlockingFlush(BUILT_INDEXES); }
/** * This method is used to remove information about truncation time for specified column family */ public static synchronized void removeTruncationRecord(UUID cfId) { String req = "DELETE truncated_at[?] from system.%s WHERE key = '%s'"; executeInternal(String.format(req, LOCAL, LOCAL), cfId); truncationRecords = null; forceBlockingFlush(LOCAL); }
public static void updatePreferredIP(InetAddress ep, InetAddress preferred_ip) { String req = "INSERT INTO system.%s (peer, preferred_ip) VALUES (?, ?)"; executeInternal(String.format(req, PEERS), ep, preferred_ip); forceBlockingFlush(PEERS); }
/** * This method is used to update the System Keyspace with the new tokens for this node */ public static synchronized void updateTokens(Collection<Token> tokens) { assert !tokens.isEmpty() : "removeEndpoint should be used instead"; String req = "INSERT INTO system.%s (key, tokens) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL, LOCAL), tokensAsSet(tokens)); forceBlockingFlush(LOCAL); }
public static void setBootstrapState(BootstrapState state) { String req = "INSERT INTO system.%s (key, bootstrapped) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL, LOCAL), state.name()); forceBlockingFlush(LOCAL); }
public static void finishViewBuildStatus(String ksname, String viewName) { // We flush the view built first, because if we fail now, we'll restart at the last place we checkpointed // view build. // If we flush the delete first, we'll have to restart from the beginning. // Also, if writing to the built_view succeeds, but the view_builds_in_progress deletion fails, we will be able // to skip the view build next boot. setViewBuilt(ksname, viewName, false); executeInternal(String.format("DELETE FROM system.%s WHERE keyspace_name = ? AND view_name = ?", VIEWS_BUILDS_IN_PROGRESS), ksname, viewName); forceBlockingFlush(VIEWS_BUILDS_IN_PROGRESS); }
public static synchronized void saveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, CommitLogPosition position) { String req = "UPDATE system.%s SET truncated_at = truncated_at + ? WHERE key = '%s'"; executeInternal(String.format(req, LOCAL, LOCAL), truncationAsMapEntry(cfs, truncatedAt, position)); truncationRecords = null; forceBlockingFlush(LOCAL); }
public static void finishViewBuildStatus(String ksname, String viewName) { // We flush the view built first, because if we fail now, we'll restart at the last place we checkpointed // view build. // If we flush the delete first, we'll have to restart from the beginning. // Also, if writing to the built_view succeeds, but the view_builds_in_progress deletion fails, we will be able // to skip the view build next boot. setViewBuilt(ksname, viewName, false); executeInternal(String.format("DELETE FROM system.%s WHERE keyspace_name = ? AND view_name = ?", VIEWS_BUILDS_IN_PROGRESS), ksname, viewName); forceBlockingFlush(VIEWS_BUILDS_IN_PROGRESS); }
public static synchronized void saveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, CommitLogPosition position) { String req = "UPDATE system.%s SET truncated_at = truncated_at + ? WHERE key = '%s'"; executeInternal(String.format(req, LOCAL, LOCAL), truncationAsMapEntry(cfs, truncatedAt, position)); truncationRecords = null; forceBlockingFlush(LOCAL); }
public static void setBootstrapState(BootstrapState state) { String req = "INSERT INTO system.%s (key, bootstrapped) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), state.name()); forceBlockingFlush(LOCAL_CF); }
public static void finishViewBuildStatus(String ksname, String viewName) { // We flush the view built first, because if we fail now, we'll restart at the last place we checkpointed // view build. // If we flush the delete first, we'll have to restart from the beginning. // Also, if writing to the built_view succeeds, but the view_builds_in_progress deletion fails, we will be able // to skip the view build next boot. setViewBuilt(ksname, viewName, false); executeInternal(String.format("DELETE FROM system.%s WHERE keyspace_name = ? AND view_name = ?", VIEWS_BUILDS_IN_PROGRESS), ksname, viewName); forceBlockingFlush(VIEWS_BUILDS_IN_PROGRESS); }
public static void setBootstrapState(BootstrapState state) { String req = "INSERT INTO system.%s (key, bootstrapped) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL, LOCAL), state.name()); forceBlockingFlush(LOCAL); }