Package com.metamx.common

Examples of com.metamx.common.ISE


    @Override
    public synchronized T get()
    {
      if (closed) {
        throw new ISE("Already Closed!");
      }

      return object;
    }
View Full Code Here


    @Override
    public synchronized void close() throws IOException
    {
      if (closed) {
        log.warn(new ISE("Already Closed!"), "Already closed");
        return;
      }

      synchronized (objects) {
        closed = true;
View Full Code Here

    {
      // Group by bucket, sort by timestamp
      final Optional<Bucket> bucket = getConfig().getBucket(inputRow);

      if (!bucket.isPresent()) {
        throw new ISE("WTF?! No bucket found for row: %s", inputRow);
      }

      context.write(
          new SortableBytes(
              bucket.get().toGroupKey(),
View Full Code Here

      int shardNum = bytes.getInt();
      if (config.get("mapred.job.tracker").equals("local")) {
        return shardNum % numPartitions;
      } else {
        if (shardNum >= numPartitions) {
          throw new ISE("Not enough partitions, shard[%,d] >= numPartitions[%,d]", shardNum, numPartitions);
        }
        return shardNum;

      }
    }
View Full Code Here

                  log.info("No need to move file[s3://%s/%s] onto itself", s3Bucket, s3Path);
                } else {
                  final S3Object[] list = s3Client.listObjects(s3Bucket, s3Path, "");
                  if (list.length == 0) {
                    // should never happen
                    throw new ISE("Unable to list object [s3://%s/%s]", s3Bucket, s3Path);
                  }
                  final S3Object s3Object = list[0];
                  if (s3Object.getStorageClass() != null &&
                      s3Object.getStorageClass().equals(S3Object.STORAGE_CLASS_GLACIER)) {
                    log.warn("Cannot move file[s3://%s/%s] of storage class glacier, skipping.", s3Bucket, s3Path);
View Full Code Here

    }

    final Set<QueryableDruidServer> servers = priorityServers.getValue();
    switch (servers.size()) {
      case 0:
        throw new ISE("[%s] Something hella weird going on here. We should not be here", segment.getIdentifier());
      case 1:
        return priorityServers.getValue().iterator().next();
      default:
        return serverSelectorStrategy.pick(servers, segment);
    }
View Full Code Here

  {
   if ("stdin".equals(parentStreamName)) {
     return System.in;
   }
   else {
     throw new ISE("Unknown stream name[%s]", parentStreamName);
   }
  }
View Full Code Here

    );

    // Won't hurt in remote mode, and is required for setting up locks in local mode:
    try {
      if (!task.isReady(taskActionClientFactory.create(task))) {
        throw new ISE("Task is not ready to run yet!", task.getId());
      }
    } catch (Exception e) {
      throw new ISE(e, "Failed to run isReady", task.getId());
    }

    statusFuture = Futures.transform(
        taskRunner.run(task),
        new Function<TaskStatus, TaskStatus>()
View Full Code Here

  @Override
  public <T> QueryRunner<T> getQueryRunnerForIntervals(Query<T> query, Iterable<Interval> intervals)
  {
    final QueryRunnerFactory<T, Query<T>> factory = conglomerate.findFactory(query);
    if (factory == null) {
      throw new ISE("Unknown query type[%s].", query.getClass());
    }

    final QueryToolChest<T, Query<T>> toolChest = factory.getToolchest();

    DataSource dataSource = query.getDataSource();
View Full Code Here

    for (int i = start; i < Integer.MAX_VALUE; i++) {
      if (!usedPorts.contains(i)) {
        return i;
      }
    }
    throw new ISE("All ports are Used..");
  }
View Full Code Here

TOP

Related Classes of com.metamx.common.ISE

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.