@Override public JobSchedulingStatus getJobSchedulingStatus(JobID jobID) throws IOException { checkNotNull(jobID); try { final String zkPath = createZkPath(jobID); final Stat stat = client.checkExists().forPath(zkPath); if (stat != null) { // found some data, try to parse it final byte[] data = client.getData().forPath(zkPath); if (data != null) { try { final String name = new String(data, ENCODING); return JobSchedulingStatus.valueOf(name); } catch (IllegalArgumentException e) { throw new IOException("Found corrupt data in ZooKeeper: " + Arrays.toString(data) + " is no valid job status"); } } } // nothing found, yet, must be in status 'PENDING' return JobSchedulingStatus.PENDING; } catch (Exception e) { throw new IOException("Get finished state from zk fail for job " + jobID.toString(), e); } }
@Override public JobSchedulingStatus getJobSchedulingStatus(JobID jobID) throws IOException { checkNotNull(jobID); try { final String zkPath = createZkPath(jobID); final Stat stat = client.checkExists().forPath(zkPath); if (stat != null) { // found some data, try to parse it final byte[] data = client.getData().forPath(zkPath); if (data != null) { try { final String name = new String(data, ENCODING); return JobSchedulingStatus.valueOf(name); } catch (IllegalArgumentException e) { throw new IOException("Found corrupt data in ZooKeeper: " + Arrays.toString(data) + " is no valid job status"); } } } // nothing found, yet, must be in status 'PENDING' return JobSchedulingStatus.PENDING; } catch (Exception e) { throw new IOException("Get finished state from zk fail for job " + jobID.toString(), e); } }
@Override public JobSchedulingStatus getJobSchedulingStatus(JobID jobID) throws IOException { checkNotNull(jobID); try { final String zkPath = createZkPath(jobID); final Stat stat = client.checkExists().forPath(zkPath); if (stat != null) { // found some data, try to parse it final byte[] data = client.getData().forPath(zkPath); if (data != null) { try { final String name = new String(data, ENCODING); return JobSchedulingStatus.valueOf(name); } catch (IllegalArgumentException e) { throw new IOException("Found corrupt data in ZooKeeper: " + Arrays.toString(data) + " is no valid job status"); } } } // nothing found, yet, must be in status 'PENDING' return JobSchedulingStatus.PENDING; } catch (Exception e) { throw new IOException("Get finished state from zk fail for job " + jobID.toString(), e); } }
@Override public JobSchedulingStatus getJobSchedulingStatus(JobID jobID) throws IOException { checkNotNull(jobID); try { final String zkPath = createZkPath(jobID); final Stat stat = client.checkExists().forPath(zkPath); if (stat != null) { // found some data, try to parse it final byte[] data = client.getData().forPath(zkPath); if (data != null) { try { final String name = new String(data, ENCODING); return JobSchedulingStatus.valueOf(name); } catch (IllegalArgumentException e) { throw new IOException("Found corrupt data in ZooKeeper: " + Arrays.toString(data) + " is no valid job status"); } } } // nothing found, yet, must be in status 'PENDING' return JobSchedulingStatus.PENDING; } catch (Exception e) { throw new IOException("Get finished state from zk fail for job " + jobID.toString(), e); } }
private void writeEnumToZooKeeper(JobID jobID, JobSchedulingStatus status) throws Exception { final String zkPath = createZkPath(jobID); this.client.newNamespaceAwareEnsurePath(zkPath).ensure(client.getZookeeperClient()); this.client.setData().forPath(zkPath, status.name().getBytes(ENCODING)); } }
private void writeEnumToZooKeeper(JobID jobID, JobSchedulingStatus status) throws Exception { final String zkPath = createZkPath(jobID); this.client.newNamespaceAwareEnsurePath(zkPath).ensure(client.getZookeeperClient()); this.client.setData().forPath(zkPath, status.name().getBytes(ENCODING)); } }
private void writeEnumToZooKeeper(JobID jobID, JobSchedulingStatus status) throws Exception { final String zkPath = createZkPath(jobID); this.client.newNamespaceAwareEnsurePath(zkPath).ensure(client.getZookeeperClient()); this.client.setData().forPath(zkPath, status.name().getBytes(ENCODING)); } }
private void writeEnumToZooKeeper(JobID jobID, JobSchedulingStatus status) throws Exception { final String zkPath = createZkPath(jobID); this.client.newNamespaceAwareEnsurePath(zkPath).ensure(client.getZookeeperClient()); this.client.setData().forPath(zkPath, status.name().getBytes(ENCODING)); } }