public static void failRepairs(UUID id, String keyspaceName, String[] cfnames, Throwable t) { for (String cfname : cfnames) failedRepairJob(id, keyspaceName, cfname, t); }
public static void setViewRemoved(String keyspaceName, String viewName) { String buildReq = "DELETE FROM %s.%s WHERE keyspace_name = ? AND view_name = ?"; QueryProcessor.executeInternal(String.format(buildReq, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, VIEW_BUILD_STATUS), keyspaceName, viewName); forceBlockingFlush(VIEW_BUILD_STATUS); }
public static void failParentRepair(UUID parent_id, Throwable t) { String query = "UPDATE %s.%s SET finished_at = toTimestamp(now()), exception_message=?, exception_stacktrace=? WHERE parent_id=%s"; StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); String fmtQuery = String.format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, PARENT_REPAIR_HISTORY, parent_id.toString()); processSilent(fmtQuery, t.getMessage(), sw.toString()); }
public static void startParentRepair(UUID parent_id, String keyspaceName, String[] cfnames, RepairOption options) { Collection<Range<Token>> ranges = options.getRanges(); String query = "INSERT INTO %s.%s (parent_id, keyspace_name, columnfamily_names, requested_ranges, started_at, options)"+ " VALUES (%s, '%s', { '%s' }, { '%s' }, toTimestamp(now()), { %s })"; String fmtQry = String.format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, PARENT_REPAIR_HISTORY, parent_id.toString(), keyspaceName, Joiner.on("','").join(cfnames), Joiner.on("','").join(ranges), toCQLMap(options.asMap(), RepairOption.RANGES_KEY, RepairOption.COLUMNFAMILIES_KEY)); processSilent(fmtQry); }
SystemDistributedKeyspace.startRepairs(getId(), parentRepairSession, keyspace, cfnames, ranges, endpoints); Tracing.traceRepair(message); set(new RepairSessionResult(id, keyspace, ranges, Lists.<RepairResult>newArrayList())); SystemDistributedKeyspace.failRepairs(getId(), keyspace, cfnames, new RuntimeException(message)); return; Exception e = new IOException(message); setException(e); SystemDistributedKeyspace.failRepairs(getId(), keyspace, cfnames, e); return;
SystemDistributedKeyspace.startParentRepair(parentSession, keyspace, cfnames, options); long repairedAt; try SystemDistributedKeyspace.failParentRepair(parentSession, t); fireErrorAndComplete(tag, progress.get(), totalProgress, t.getMessage()); return;
public void removeView(String name) { View view = viewsByName.remove(name); if (view == null) return; forTable(view.getDefinition().baseTableMetadata()).removeByName(name); SystemKeyspace.setViewRemoved(keyspace.getName(), view.name); SystemDistributedKeyspace.setViewRemoved(keyspace.getName(), view.name); }
public void onFailure(Throwable t) { fireProgressEvent(tag, new ProgressEvent(ProgressEventType.ERROR, progress.get(), totalProgress, t.getMessage())); SystemDistributedKeyspace.failParentRepair(parentSession, t); repairComplete(); }
ReducingKeyIterator iter = new ReducingKeyIterator(sstables)) SystemDistributedKeyspace.startViewBuild(ksname, viewName, localHostId); while (!isStopped && iter.hasNext())
maybeAddOrUpdateKeyspace(SystemDistributedKeyspace.metadata());
public static void startParentRepair(UUID parent_id, String keyspaceName, String[] cfnames, RepairOption options) { Collection<Range<Token>> ranges = options.getRanges(); String query = "INSERT INTO %s.%s (parent_id, keyspace_name, columnfamily_names, requested_ranges, started_at, options)"+ " VALUES (%s, '%s', { '%s' }, { '%s' }, toTimestamp(now()), { %s })"; String fmtQry = String.format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, PARENT_REPAIR_HISTORY, parent_id.toString(), keyspaceName, Joiner.on("','").join(cfnames), Joiner.on("','").join(ranges), toCQLMap(options.asMap(), RepairOption.RANGES_KEY, RepairOption.COLUMNFAMILIES_KEY)); processSilent(fmtQry); }
SystemDistributedKeyspace.startRepairs(getId(), parentRepairSession, keyspace, cfnames, ranges, endpoints); Tracing.traceRepair(message); set(new RepairSessionResult(id, keyspace, ranges, Lists.<RepairResult>newArrayList())); SystemDistributedKeyspace.failRepairs(getId(), keyspace, cfnames, new RuntimeException(message)); return; Exception e = new IOException(message); setException(e); SystemDistributedKeyspace.failRepairs(getId(), keyspace, cfnames, e); return;
SystemDistributedKeyspace.startParentRepair(parentSession, keyspace, cfnames, options); long repairedAt; try SystemDistributedKeyspace.failParentRepair(parentSession, t); fireErrorAndComplete(tag, progress.get(), totalProgress, t.getMessage()); return;
public void removeView(String name) { View view = viewsByName.remove(name); if (view == null) return; forTable(view.getDefinition().baseTableMetadata()).removeByName(name); SystemKeyspace.setViewRemoved(keyspace.getName(), view.name); SystemDistributedKeyspace.setViewRemoved(keyspace.getName(), view.name); }
public void onFailure(Throwable t) { fireProgressEvent(tag, new ProgressEvent(ProgressEventType.ERROR, progress.get(), totalProgress, t.getMessage())); SystemDistributedKeyspace.failParentRepair(parentSession, t); repairComplete(); }
ReducingKeyIterator iter = new ReducingKeyIterator(sstables)) SystemDistributedKeyspace.startViewBuild(ksname, viewName, localHostId); while (!isStopped && iter.hasNext())
maybeAddOrUpdateKeyspace(SystemDistributedKeyspace.metadata());
public static void successfulParentRepair(UUID parent_id, Collection<Range<Token>> successfulRanges) { String query = "UPDATE %s.%s SET finished_at = toTimestamp(now()), successful_ranges = {'%s'} WHERE parent_id=%s"; String fmtQuery = String.format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, PARENT_REPAIR_HISTORY, Joiner.on("','").join(successfulRanges), parent_id.toString()); processSilent(fmtQuery); }
public static void startParentRepair(UUID parent_id, String keyspaceName, String[] cfnames, RepairOption options) { Collection<Range<Token>> ranges = options.getRanges(); String query = "INSERT INTO %s.%s (parent_id, keyspace_name, columnfamily_names, requested_ranges, started_at, options)"+ " VALUES (%s, '%s', { '%s' }, { '%s' }, toTimestamp(now()), { %s })"; String fmtQry = String.format(query, SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, PARENT_REPAIR_HISTORY, parent_id.toString(), keyspaceName, Joiner.on("','").join(cfnames), Joiner.on("','").join(ranges), toCQLMap(options.asMap(), RepairOption.RANGES_KEY, RepairOption.COLUMNFAMILIES_KEY)); processSilent(fmtQry); }
SystemDistributedKeyspace.startRepairs(getId(), parentRepairSession, keyspace, cfnames, ranges, endpoints); Tracing.traceRepair(message); set(new RepairSessionResult(id, keyspace, ranges, Lists.<RepairResult>newArrayList())); SystemDistributedKeyspace.failRepairs(getId(), keyspace, cfnames, new RuntimeException(message)); return; Exception e = new IOException(message); setException(e); SystemDistributedKeyspace.failRepairs(getId(), keyspace, cfnames, e); return;