<commit_before>package org.goldenorb.jet;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Text;

/*
 * Start of non-generated import declaration code -- any code written outside of this block will be
 * removed in subsequent code generations.
 */
import org.goldenorb.Messages;
import org.goldenorb.OrbPartitionCommunicationProtocol;
import org.goldenorb.Vertices;
import org.goldenorb.conf.OrbConfiguration;
import org.goldenorb.io.input.RawSplit;
import org.apache.hadoop.ipc.RPC;

import java.net.InetSocketAddress;

/* End of non-generated import declaraction code */

/**
 * This class is the proxy object for an OrbPartition into the LeaderGroup
 */
public class OrbPartitionMember implements org.goldenorb.zookeeper.Member,
    org.goldenorb.OrbPartitionCommunicationProtocol, org.goldenorb.conf.OrbConfigurable {
  
  /**
   * the id assigned to this partition
   */
  private int partitionID;
  
  /**
   * the total number vertices assigned to this partition
   */
  private int numberOfVertices;
  
  /**
   * the current superstep that the OrbPartition is on
   */
  private int superStep;
  
  /**
   * the total number of messages sent so far
   */
  private int messagesSent;
  
  /**
   * the percent complete for this superstep
   */
  private float percentComplete;
  
  /**
   * the host name of the machine running this OrbTracker
   */
  private String hostname;
  
  /**
   * whether this member is the leader
   */
  private boolean leader;
  
  /**
   * the port number the OrbTracker provides RPC on
   */
  private int port;
  
  /*
   * Start of non-generated variable declaration code -- any code written outside of this block will be
   * removed in subsequent code generations.
   */
  private OrbPartitionCommunicationProtocol client;
  private OrbConfiguration orbConf;
  
  /* End of non-generated variable declaraction code */

  /**
   * 
   */
  public OrbPartitionMember() {}
  
  /*
   * Start of non-generated method code -- any code written outside of this block will be removed in
   * subsequent code generations.
   */
  @Override
  public long getProtocolVersion(String arg0, long arg1) throws IOException {
    return this.versionID;
  }
  
  @Override
  public void setOrbConf(OrbConfiguration orbConf) {
    this.orbConf = orbConf;
  }
  
  @Override
  public OrbConfiguration getOrbConf() {
    return orbConf;
  }
  
  @Override
  public void sendVertices(Vertices vertices) {
    client.sendVertices(vertices);
  }
  
  @Override
  public void sendMessages(Messages messages) {
    client.sendMessages(messages);
  }
  
  public void initProxy() throws IOException {
    initProxy(this.orbConf);
  }
  
  @Override
  public void becomeActive() {
    client.becomeActive();
  }
  
  @Override
  public void loadVerticesFromInputSplit(RawSplit rawsplit) {
    client.loadVerticesFromInputSplit(rawsplit);
  }
  
  public void initProxy(OrbConfiguration orbConf) throws IOException {
    InetSocketAddress addr = new InetSocketAddress(hostname, port);
    client = (OrbPartitionCommunicationProtocol) RPC.waitForProxy(OrbPartitionCommunicationProtocol.class,
      OrbPartitionCommunicationProtocol.versionID, addr, orbConf);
  }
  
  /* End of non-generated method code */

  /**
   * gets the id assigned to this partition
   * 
   * @return
   */
  public int getPartitionID() {
    return partitionID;
  }
  
  /**
   * sets the id assigned to this partition
   * 
   * @param partitionID
   */
  public void setPartitionID(int partitionID) {
    this.partitionID = partitionID;
  }
  <commit_msg>no message<commit_after>package org.goldenorb.jet;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Text;

/*
 * Start of non-generated import declaration code -- any code written outside of this block will be
 * removed in subsequent code generations.
 */
import org.goldenorb.Messages;
import org.goldenorb.OrbPartitionCommunicationProtocol;
import org.goldenorb.Vertices;
import org.goldenorb.conf.OrbConfiguration;
import org.goldenorb.io.input.RawSplit;
import org.apache.hadoop.ipc.RPC;

import java.net.InetSocketAddress;

/* End of non-generated import declaraction code */

/**
 * This class is the proxy object for an OrbPartition into the LeaderGroup
 */
public class OrbPartitionMember implements org.goldenorb.zookeeper.Member,
    org.goldenorb.OrbPartitionCommunicationProtocol, org.goldenorb.conf.OrbConfigurable {
  
  /**
   * the id assigned to this partition
   */
  private int partitionID;
  
  /**
   * the total number vertices assigned to this partition
   */
  private int numberOfVertices;
  
  /**
   * the current superstep that the OrbPartition is on
   */
  private int superStep;
  
  /**
   * the total number of messages sent so far
   */
  private int messagesSent;
  
  /**
   * the percent complete for this superstep
   */
  private float percentComplete;
  
  /**
   * the host name of the machine running this OrbTracker
   */
  private String hostname;
  
  /**
   * whether this member is the leader
   */
  private boolean leader;
  
  /**
   * the port number the OrbTracker provides RPC on
   */
  private int port;
  
  /*
   * Start of non-generated variable declaration code -- any code written outside of this block will be
   * removed in subsequent code generations.
   */
  private OrbPartitionCommunicationProtocol client;
  private OrbConfiguration orbConf;
  
  /* End of non-generated variable declaraction code */

  /**
   * 
   */
  public OrbPartitionMember() {}
  
  /*
   * Start of non-generated method code -- any code written outside of this block will be removed in
   * subsequent code generations.
   */
  @Override
  public long getProtocolVersion(String arg0, long arg1) throws IOException {
    return this.versionID;
  }
  
  @Override
  public void setOrbConf(OrbConfiguration orbConf) {
    this.orbConf = orbConf;
  }
  
  @Override
  public OrbConfiguration getOrbConf() {
    return orbConf;
  }
  
  @Override
  public void sendVertices(Vertices vertices) {
    client.sendVertices(vertices);
  }
  
  @Override
  public void sendMessages(Messages messages) {
    client.sendMessages(messages);
  }
  
  public void initProxy() throws IOException {
    initProxy(this.orbConf);
  }
  
  @Override
  public void becomeActive(int partitionID) {
    client.becomeActive(partitionID);
  }
  
  @Override
  public void loadVerticesFromInputSplit(RawSplit rawsplit) {
    client.loadVerticesFromInputSplit(rawsplit);
  }
  
  public void initProxy(OrbConfiguration orbConf) throws IOException {
    if(client == null){
      InetSocketAddress addr = new InetSocketAddress(hostname, port);
      client = (OrbPartitionCommunicationProtocol) RPC.waitForProxy(OrbPartitionCommunicationProtocol.class,
        OrbPartitionCommunicationProtocol.versionID, addr, orbConf);
    }
  }
  
  public boolean equals(Object rhs) {
    return hostname.equals(((OrbPartitionMember) rhs).getHostname()) && (port == (((OrbPartitionMember) rhs).getPort()));
  }
  
  /* End of non-generated method code */

  /**
   * gets the id assigned to this partition
   * 
   * @return
   */
  public int getPartitionID() {
    return partitionID;
  }
  
  /**
   * sets the id assigned to this partition
   * 
   * @param partitionID
   */
  public void setPartitionID(int partitionID) {
    this.partitionID = partitionID;
  }
  
{'fraction_non_alphanumeric': 0.0835347837765243, 'fraction_numerical': 0.0005372011818426001, 'mean_word_length': 3.2971725331794577, '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': '6739962', 'n_tokens_mistral': 2183, 'n_tokens_neox': 2162, 'n_words': 630}