<commit_before>/*
 *  Copyright (c) 2012-2013 DataTorrent, Inc.
 *  All Rights Reserved.
 */
package com.datatorrent.stram.plan.physical;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


/**
 *
 * Representation of a container for physical objects of DAG to be placed in
 * <p>
 * <br>
 * References the actual container assigned by the resource manager which
 * hosts the streaming operators in the execution layer.<br>
 * The container reference may change throughout the lifecycle of the
 * application due to failure/recovery or scheduler decisions in general. <br>
 *
 * @since 0.3.5
 */
public class PTContainer {
  public enum State {
    NEW,
    ALLOCATED,
    ACTIVE,
    TIMEDOUT,
    KILLED
  }

  volatile PTContainer.State state = State.NEW;
  private int requiredMemoryMB;
  private int allocatedMemoryMB;
  private int resourceRequestPriority;

  private final PhysicalPlan plan;
  private final int seq;
  List<PTOperator> operators = new ArrayList<PTOperator>();
  Set<PTOperator> pendingUndeploy = Collections.newSetFromMap(new ConcurrentHashMap<PTOperator, Boolean>());
  Set<PTOperator> pendingDeploy = Collections.newSetFromMap(new ConcurrentHashMap<PTOperator, Boolean>());

  // execution layer properties
  String containerId; // assigned yarn container id
  public String host;
  public InetSocketAddress bufferServerAddress;
  public String nodeHttpAddress;
  int restartAttempts;

  PTContainer(PhysicalPlan plan) {<commit_msg>remove unused state<commit_after>/*
 *  Copyright (c) 2012-2013 DataTorrent, Inc.
 *  All Rights Reserved.
 */
package com.datatorrent.stram.plan.physical;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


/**
 *
 * Representation of a container for physical objects of DAG to be placed in
 * <p>
 * <br>
 * References the actual container assigned by the resource manager which
 * hosts the streaming operators in the execution layer.<br>
 * The container reference may change throughout the lifecycle of the
 * application due to failure/recovery or scheduler decisions in general. <br>
 *
 * @since 0.3.5
 */
public class PTContainer {
  public enum State {
    NEW,
    ALLOCATED,
    ACTIVE,
    KILLED
  }

  volatile PTContainer.State state = State.NEW;
  private int requiredMemoryMB;
  private int allocatedMemoryMB;
  private int resourceRequestPriority;

  private final PhysicalPlan plan;
  private final int seq;
  List<PTOperator> operators = new ArrayList<PTOperator>();
  Set<PTOperator> pendingUndeploy = Collections.newSetFromMap(new ConcurrentHashMap<PTOperator, Boolean>());
  Set<PTOperator> pendingDeploy = Collections.newSetFromMap(new ConcurrentHashMap<PTOperator, Boolean>());

  // execution layer properties
  String containerId; // assigned yarn container id
  public String host;
  public InetSocketAddress bufferServerAddress;
  public String nodeHttpAddress;
  int restartAttempts;

  PTContainer(PhysicalPlan plan) {
{'fraction_non_alphanumeric': 0.082010582010582, 'fraction_numerical': 0.006466784244562022, 'mean_word_length': 4.671666666666667, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '4443430', 'n_tokens_mistral': 959, 'n_tokens_neox': 926, 'n_words': 301}