Refine search
private AbstractRunner getRunner(Iterable<Dataset> datasets) { try { return this.runnerClass.getDeclaredConstructor(Iterable.class, State.class).newInstance(datasets, this.props); } catch (Throwable t) { LOG.error("Failed to instantiate data completeness verification class", t); throw Throwables.propagate(t); } }
private static TransactionEventRecord newRecordForType(short type, long transactionID, long writeOrderID) { Constructor<? extends TransactionEventRecord> constructor = TYPES.get(type); Preconditions.checkNotNull(constructor, "Unknown action " + Integer.toHexString(type)); try { return constructor.newInstance(transactionID, writeOrderID); } catch (Exception e) { throw Throwables.propagate(e); } } }
@Override public UnderFileSystem create(String path, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Preconditions.checkNotNull(path, "path"); if (checkGoogleCredentials(conf)) { try { return GCSUnderFileSystem.createInstance(new AlluxioURI(path), conf, alluxioConf); } catch (ServiceException e) { LOG.error("Failed to create GCSUnderFileSystem.", e); throw Throwables.propagate(e); } } String err = "Google Credentials not available, cannot create GCS Under File System."; throw Throwables.propagate(new IOException(err)); }
Preconditions.checkNotNull(port, "HTTPSource requires a port number to be" + " specified"); handler.configure(new Context(subProps)); } catch (ClassNotFoundException ex) { LOG.error("Error while configuring HTTPSource. Exception follows.", ex); Throwables.propagate(ex); } catch (ClassCastException ex) { LOG.error("Deserializer is not an instance of HTTPSourceHandler." + "Deserializer must implement HTTPSourceHandler."); Throwables.propagate(ex); } catch (Exception ex) { LOG.error("Error configuring HTTPSource!", ex); Throwables.propagate(ex);
@SuppressWarnings("unchecked") private Map<byte[], NavigableMap<byte[], Long>> getFamilyMap(Increment inc) { Preconditions.checkNotNull(refGetFamilyMap, "Increment.getFamilymap() not found"); Preconditions.checkNotNull(inc, "Increment required"); Map<byte[], NavigableMap<byte[], Long>> familyMap = null; try { Object familyObj = refGetFamilyMap.invoke(inc); familyMap = (Map<byte[], NavigableMap<byte[], Long>>) familyObj; } catch (IllegalAccessException e) { logger.warn("Unexpected error calling getFamilyMap()", e); Throwables.propagate(e); } catch (InvocationTargetException e) { logger.warn("Unexpected error calling getFamilyMap()", e); Throwables.propagate(e); } return familyMap; }
@Override public UnderFileSystem create(String path, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Preconditions.checkNotNull(path, "path"); if (checkCOSCredentials(conf)) { try { return COSUnderFileSystem.createInstance(new AlluxioURI(path), conf, alluxioConf); } catch (Exception e) { throw Throwables.propagate(e); } } String err = "COS Credentials not available, cannot create COS Under File System."; throw Throwables.propagate(new IOException(err)); }
@Override public UnderFileSystem create(String path, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Preconditions.checkNotNull(path, "path"); if (checkOSSCredentials(conf)) { try { return OSSUnderFileSystem.createInstance(new AlluxioURI(path), conf, alluxioConf); } catch (Exception e) { throw Throwables.propagate(e); } } String err = "OSS Credentials not available, cannot create OSS Under File System."; throw Throwables.propagate(new IOException(err)); }
@Override public void run() { try { renewDelegationToken(); } catch (IOException ioe) { LOGGER.error("Failed to renew delegation token", ioe); throw Throwables.propagate(ioe); } catch (InterruptedException ie) { LOGGER.error("Token renew task has been interrupted"); Thread.currentThread().interrupt(); } } }, this.tokenRenewIntervalInMinutes, this.tokenRenewIntervalInMinutes, TimeUnit.MINUTES));
@Override public UnderFileSystem create(String path, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Preconditions.checkNotNull(path, "path"); try { return S3AUnderFileSystem.createInstance(new AlluxioURI(path), conf, alluxioConf); } catch (AmazonClientException e) { throw Throwables.propagate(e); } }
@Override public UnderFileSystem create(String path, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Preconditions.checkNotNull(path, "path"); if (checkSwiftCredentials(conf)) { try { return new SwiftUnderFileSystem(new AlluxioURI(path), conf, alluxioConf); } catch (Exception e) { throw Throwables.propagate(e); } } String err = "Swift Credentials not available, cannot create Swift Under File System."; throw Throwables.propagate(new IOException(err)); }
@Override public String getVersion(final Interval interval) { try { // Side effect: Calling getVersion causes a lock to be acquired final LockAcquireAction action = new LockAcquireAction(TaskLockType.EXCLUSIVE, interval, lockTimeoutMs); final TaskLock lock = Preconditions.checkNotNull( toolbox.getTaskActionClient().submit(action), "Cannot acquire a lock for interval[%s]", interval ); return lock.getVersion(); } catch (IOException e) { throw Throwables.propagate(e); } } };
public static Producer getKafkaProducer(Properties props) { Object producerObject = KafkaWriterHelper.getKafkaProducer(props); try { Producer producer = (Producer) producerObject; return producer; } catch (ClassCastException e) { log.error("Failed to instantiate Kafka producer " + producerObject.getClass().getName() + " as instance of Producer.class", e); throw Throwables.propagate(e); } }
@Override public String runTask(Object taskObject) { try { final FullResponseHolder response = druidLeaderClient.go( druidLeaderClient.makeRequest( HttpMethod.POST, "/druid/indexer/v1/task" ).setContent(MediaType.APPLICATION_JSON, jsonMapper.writeValueAsBytes(taskObject)) ); if (!response.getStatus().equals(HttpResponseStatus.OK)) { throw new ISE("Failed to post task[%s]", taskObject); } final Map<String, Object> resultMap = jsonMapper.readValue( response.getContent(), JacksonUtils.TYPE_REFERENCE_MAP_STRING_OBJECT ); final String taskId = (String) resultMap.get("task"); return Preconditions.checkNotNull(taskId, "Null task id for task[%s]", taskObject); } catch (Exception e) { throw Throwables.propagate(e); } }
public static Producer getKafkaProducer(Properties props) { Object producerObject = KafkaWriterHelper.getKafkaProducer(props); try { Producer producer = (Producer) producerObject; return producer; } catch (ClassCastException e) { log.error("Failed to instantiate Kafka producer " + producerObject.getClass().getName() + " as instance of Producer.class", e); throw Throwables.propagate(e); } }
); final String killedTaskId = (String) resultMap.get("task"); Preconditions.checkNotNull(killedTaskId, "Null task id returned for task[%s]", taskId); Preconditions.checkState( taskId.equals(killedTaskId), throw Throwables.propagate(e);