Java Code Examples for java.util.HashSet#toString()

The following examples show how to use java.util.HashSet#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EncodingConflictAnalyserTool.java    From workcraft with MIT License 6 votes vote down vote up
@Override
public Object getValueAt(int row, int col) {
    Object result = null;
    HashSet<String> core = cores.get(row);
    if (core != null) {
        switch (col) {
        case COLUMN_CORE:
            result = core.toString();
            break;
        case COLUMN_COLOR:
            result = "";
            break;
        default:
            result = null;
            break;
        }
    }
    return result;
}
 
Example 2
Source File: EntriesScannedQuantileReport.java    From incubator-pinot with Apache License 2.0 6 votes vote down vote up
@Override
public boolean execute() throws Exception {
  HashSet<String> tableNamesWithoutType = new HashSet<>();
  if (_tableNamesWithoutType != null && !_tableNamesWithoutType.trim().equals("")) {
    tableNamesWithoutType.addAll(Arrays.asList(_tableNamesWithoutType.split(",")));
  }
  String tableNamesWithoutTypeStr;
  if (tableNamesWithoutType.isEmpty()) {
    tableNamesWithoutTypeStr = "All tables";
  } else {
    tableNamesWithoutTypeStr = tableNamesWithoutType.toString();
  }
  LOGGER.info("\nTables{}\n", tableNamesWithoutTypeStr);


  TunerDriver fitModel = new TunerDriver().setThreadPoolSize(Runtime.getRuntime().availableProcessors() - 1)
      .setTuningStrategy(new QuantileAnalysisImpl.Builder().setTableNamesWithoutType(tableNamesWithoutType).build())
      .setInputIterator(new LogInputIteratorImpl.Builder()
          .setParser(new BrokerLogParserImpl())
          .setPath(_brokerLog)
          .build());
  fitModel.execute();
  return true;
}
 
Example 3
Source File: AnalysisRequestsTestWorkbench.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
private ICallback<String, Object> getParsesDone() {
    return new ICallback<String, Object>() {

        @Override
        public String call(Object arg) {
            HashSet<String> hashSet = new HashSet<String>();
            synchronized (lock) {
                for (Tuple3<ISimpleNode, Throwable, ParserInfo> tup : parsesDone) {
                    hashSet.add(tup.o3.moduleName);
                }
            }

            return hashSet.toString();
        }
    };
}
 
Example 4
Source File: CollectMetadataForIndexTuning.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
@Override
public boolean execute() throws Exception {
  HashSet<String> tableNamesWithoutType = new HashSet<>();
  if (_tableNamesWithoutType != null && !_tableNamesWithoutType.trim().equals("")) {
    tableNamesWithoutType.addAll(Arrays.asList(_tableNamesWithoutType.split(",")));
  }
  String tableNamesWithoutTypeStr;
  if (tableNamesWithoutType.isEmpty()) {
    tableNamesWithoutTypeStr = "All tables";
  } else {
    tableNamesWithoutTypeStr = tableNamesWithoutType.toString();
  }
  LOGGER.info("\nTables{}\n", tableNamesWithoutTypeStr);

  try {
    TunerDriver metaFetch = new TunerDriver().setThreadPoolSize(Runtime.getRuntime().availableProcessors() - 1)
        .setTuningStrategy(new SegmentMetadataCollector.Builder().setTableNamesWithoutType(tableNamesWithoutType)
            .setOutputDir(_workDir)
            .build())
        .setInputIterator(new CompressedFilePathIter.Builder().setDirectory(_segmentsDir).build())
        .setMetaManager(null);
    metaFetch.execute();
  } catch (FileNotFoundException e) {
    LOGGER.error("Invalid tarred segments dir: {}", _segmentsDir);
    return false;
  }
  return true;
}
 
Example 5
Source File: ASTWalker.java    From swift-t with Apache License 2.0 4 votes vote down vote up
private void waitStmt(Context context, SwiftAST tree)
                                throws UserException {
  Wait wait = Wait.fromAST(context, tree);
  ArrayList<Var> waitEvaled = new ArrayList<Var>();
  for (SwiftAST expr: wait.getWaitExprs()) {
    Type waitExprType = TypeChecker.findExprType(context, expr);
    if (Types.isUnion(waitExprType)) {
      // Choose first alternative type
      for (Type alt: UnionType.getAlternatives(waitExprType)) {
        if (Types.canWaitForFinalize(alt)) {
          waitExprType = alt;
          break;
        }
      }
    }
    if (!Types.canWaitForFinalize(waitExprType)) {
      throw new TypeMismatchException(context, "Waiting for type " +
          waitExprType.typeName() + " is not supported");
    }
    Var res = exprWalker.eval(context, expr, waitExprType, false, null);
    waitEvaled.add(res);
  }

  ArrayList<Var> keepOpenVars = new ArrayList<Var>();
  summariseBranchVariableUsage(context,
        Arrays.asList(wait.getBlock().getVariableUsage()), keepOpenVars);


  // Quick sanity check to see we're not directly blocking
  // on any arrays written inside
  HashSet<String> waitVarSet =
      new HashSet<String>(Var.nameList(waitEvaled));
  waitVarSet.retainAll(Var.nameList(keepOpenVars));
  if (waitVarSet.size() > 0) {
    throw new UserException(context,
        "Deadlock in wait statement. The following arrays are written "
      + "inside the body of the wait: " + waitVarSet.toString());
  }

  backend.startWaitStatement(
        context.getFunctionContext().constructName("explicit-wait"),
        VarRepr.backendVars(waitEvaled),
        WaitMode.WAIT_ONLY, true, wait.isDeepWait(), ExecTarget.nonDispatchedControl());
  block(LocalContext.fnSubcontext(context), wait.getBlock());
  backend.endWaitStatement();
}