Example #1
0
 private static void removeCorruptTopologies() {
   Iterator<String> corruptTopologies = listCorruptTopologies();
   while (corruptTopologies.hasNext()) {
     String corruptId = corruptTopologies.next();
     stormClusterState.removeStorm(corruptId);
     if (nimbusBlobStore instanceof LocalFsBlobStore) {
       Iterator<String> blobKeys = getKeyListFromId(corruptId).iterator();
       while (blobKeys.hasNext()) {
         stormClusterState.removeBlobstoreKey(blobKeys.next());
       }
     }
   }
 }
Example #2
0
 private static Iterator<String> listCorruptTopologies() {
   Set<String> blobStoreTopologyIds =
       nimbusBlobStore.filterAndListKeys(
           new KeyFilter<String>() {
             @Override
             public String filter(String key) {
               return ConfigUtils.getIdFromBlobKey(key);
             }
           });
   Set<String> activeTopologyIds = new HashSet<>(stormClusterState.activeStorms());
   Sets.SetView<String> diffTopology = Sets.difference(activeTopologyIds, blobStoreTopologyIds);
   LOG.info(
       "active-topology-ids [{}] blob-topology-ids [{}] diff-topology [{}]",
       activeTopologyIds.toString(),
       blobStoreTopologyIds.toString(),
       diffTopology.toString());
   return diffTopology.iterator();
 }
Example #3
0
 @Override
 public void report(Throwable error) {
   LOG.error("Error", error);
   if (Time.deltaSecs(intervalStartTime.get()) > errorIntervalSecs) {
     intervalErrors.set(0);
     intervalStartTime.set(Time.currentTimeSecs());
   }
   if (intervalErrors.incrementAndGet() <= maxPerInterval) {
     try {
       stormClusterState.reportError(
           stormId,
           componentId,
           Utils.hostname(stormConf),
           workerTopologyContext.getThisWorkerPort().longValue(),
           error);
     } catch (UnknownHostException e) {
       throw Utils.wrapInRuntime(e);
     }
   }
 }