<commit_before>package org.apache.mesos.hdfs.state;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.protobuf.InvalidProtocolBufferException;
import org.apache.mesos.MesosNativeLibrary;
import org.apache.mesos.Protos;
import org.apache.mesos.hdfs.config.HdfsFrameworkConfig;
import org.apache.mesos.hdfs.util.HDFSConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;

import static org.apache.mesos.hdfs.util.NodeTypes.*;

/**
 * Persistence is handled by the Persistent State classes.  This class does the following:.
 * 1) transforms raw types to hdfs types and protobuf types
 * 2) handles exception logic and rethrows PersistenceException
 */

@Singleton
public class PersistentStateStore implements IPersistentStateStore {

  private final Logger logger = LoggerFactory.getLogger(getClass());
  private IHdfsStore hdfsStore;
  private DeadNodeTracker deadNodeTracker;

  private static final String FRAMEWORK_ID_KEY = "frameworkId";
  private static final String NAMENODE_TASKNAMES_KEY = "nameNodeTaskNames";
  private static final String JOURNALNODE_TASKNAMES_KEY = "journalNodeTaskNames";
  // TODO (elingg) we need to also track ZKFC's state
  // TODO (nicgrayson) add tests with in-memory state implementation for zookeeper

  @Inject
  public PersistentStateStore(HdfsFrameworkConfig hdfsFrameworkConfig) {
    MesosNativeLibrary.load(hdfsFrameworkConfig.getNativeLibrary());

    this.hdfsStore = new HdfsZkStore(hdfsFrameworkConfig);

    deadNodeTracker = new DeadNodeTracker(hdfsFrameworkConfig);

    int deadJournalNodes = getDeadJournalNodes().size();<commit_msg>removing extra blank lines<commit_after>package org.apache.mesos.hdfs.state;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.protobuf.InvalidProtocolBufferException;
import org.apache.mesos.MesosNativeLibrary;
import org.apache.mesos.Protos;
import org.apache.mesos.hdfs.config.HdfsFrameworkConfig;
import org.apache.mesos.hdfs.util.HDFSConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;

import static org.apache.mesos.hdfs.util.NodeTypes.*;

/**
 * Persistence is handled by the Persistent State classes.  This class does the following:.
 * 1) transforms raw types to hdfs types and protobuf types
 * 2) handles exception logic and rethrows PersistenceException
 */

@Singleton
public class PersistentStateStore implements IPersistentStateStore {

  private final Logger logger = LoggerFactory.getLogger(getClass());
  private IHdfsStore hdfsStore;
  private DeadNodeTracker deadNodeTracker;

  private static final String FRAMEWORK_ID_KEY = "frameworkId";
  private static final String NAMENODE_TASKNAMES_KEY = "nameNodeTaskNames";
  private static final String JOURNALNODE_TASKNAMES_KEY = "journalNodeTaskNames";
  // TODO (elingg) we need to also track ZKFC's state
  // TODO (nicgrayson) add tests with in-memory state implementation for zookeeper

  @Inject
  public PersistentStateStore(HdfsFrameworkConfig hdfsFrameworkConfig) {
    MesosNativeLibrary.load(hdfsFrameworkConfig.getNativeLibrary());
    this.hdfsStore = new HdfsZkStore(hdfsFrameworkConfig);
    deadNodeTracker = new DeadNodeTracker(hdfsFrameworkConfig);

    int deadJournalNodes = getDeadJournalNodes().size();
{'fraction_non_alphanumeric': 0.08156694392272605, 'fraction_numerical': 0.0021464985242822645, 'mean_word_length': 5.778181818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6964543', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1098, 'n_words': 276}