Skip to content

Commit

Permalink
[hotfix][zookeeper] Log changes to SchedulingState
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Jan 22, 2020
1 parent fbc1ef7 commit 1b6a074
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

import org.apache.curator.framework.CuratorFramework;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.charset.Charset;
Expand All @@ -37,6 +39,8 @@
*/
public class ZooKeeperRunningJobsRegistry implements RunningJobsRegistry {

private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperRunningJobsRegistry.class);

private static final Charset ENCODING = Charset.forName("utf-8");

/** The ZooKeeper client to use. */
Expand Down Expand Up @@ -122,6 +126,7 @@ private String createZkPath(JobID jobID) {
}

private void writeEnumToZooKeeper(JobID jobID, JobSchedulingStatus status) throws Exception {
LOG.debug("Setting scheduling state for job {} to {}.", jobID, status);
final String zkPath = createZkPath(jobID);
this.client.newNamespaceAwareEnsurePath(zkPath).ensure(client.getZookeeperClient());
this.client.setData().forPath(zkPath, status.name().getBytes(ENCODING));
Expand Down

0 comments on commit 1b6a074

Please sign in to comment.