/** * Switch state from WRITE to READ */ @Override public void switchState() { this.state = State.READ; try { this.outputStream.flush(); } catch (IOException e) { throw new GuaguaRuntimeException(e); } }
@Override public void execute() { try { doExecute(); } catch (InterruptedException e) { // transfer interrupt state to caller thread. Thread.currentThread().interrupt(); } catch (Exception e) { throw new GuaguaRuntimeException(e); } }
@Override protected void cleanup(org.apache.hadoop.mapreduce.Mapper<LongWritable, Text, Text, Text>.Context context) throws IOException, InterruptedException { this.getGuaguaService().stop(); }
protected StringBuilder getCurrentMasterNode(final String appId, final int iteration) { return getMasterNode(appId, iteration); }
protected StringBuilder getCurrentWorkerNode(final String appId, final String containerId, final int iteration) { return getWorkerNode(appId, containerId, iteration); }
protected StringBuilder getCurrentMasterSplitNode(final String appId, final int iteration) { return new StringBuilder(50).append(getMasterBaseNode(appId)).append(GuaguaConstants.ZOOKEEPER_SEPARATOR) .append(GuaguaConstants.GUAGUA_ZK_SPLIT_NODE).append(GuaguaConstants.ZOOKEEPER_SEPARATOR) .append(iteration); }
protected StringBuilder getCurrentWorkerSplitNode(final String appId, final String containerId, final int iteration) { return new StringBuilder(50).append(getAppNode(appId)).append(GuaguaConstants.ZOOKEEPER_SEPARATOR) .append(GuaguaConstants.GUAGUA_ZK_WORKERS_NODE).append(GuaguaConstants.ZOOKEEPER_SEPARATOR) .append(GuaguaConstants.GUAGUA_ZK_SPLIT_NODE).append(GuaguaConstants.ZOOKEEPER_SEPARATOR) .append(iteration).append(GuaguaConstants.ZOOKEEPER_SEPARATOR).append(containerId); }
private String getLocalHostName() { try { return InetAddress.getLocalHost().getHostName(); } catch (Exception e) { throw new GuaguaRuntimeException(e); } }
@Override protected void cleanup(org.apache.hadoop.mapreduce.Mapper<LongWritable, Text, Text, Text>.Context context) throws IOException, InterruptedException { this.getGuaguaService().stop(); }
protected StringBuilder getLastMasterNode(final String appId, final int iteration) { return getMasterNode(appId, iteration - 1); }
protected StringBuilder getLastWorkerNode(String appId, String containerId, int iteration) { return getWorkerNode(appId, containerId, iteration - 1); }
private String getLocalHostName() { try { return InetAddress.getLocalHost().getHostName(); } catch (Exception e) { throw new GuaguaRuntimeException(e); } }
private static String getLocalHostName() { // TODO use cache?? try { return InetAddress.getLocalHost().getHostName(); } catch (Exception e) { throw new GuaguaRuntimeException(e); } }
private String getLocalHostName() { try { return InetAddress.getLocalHost().getHostName(); } catch (Exception e) { throw new GuaguaRuntimeException(e); } }
@Override public boolean nextKeyValue() throws IOException { try { return this.parquetRecordReader.nextKeyValue(); } catch (InterruptedException e) { throw new GuaguaRuntimeException(e); } }