<commit_before>package ratul.myexperiments.cluster;

import ratul.myexperiments.cluster.ClusterMsgs.*;

import akka.actor.UntypedActor;
import akka.cluster.Cluster;
import akka.cluster.ClusterEvent.CurrentClusterState;
import akka.cluster.ClusterEvent.MemberUp;
import akka.cluster.Member;
import akka.cluster.MemberStatus;
import akka.cluster.singleton.ClusterSingletonManagerSettings;
import akka.cluster.singleton.ClusterSingletonProxySettings;
import akka.actor.Props;
import akka.actor.PoisonPill;

public class VideoContentStorageNode extends UntypedActor {

  Cluster cluster = Cluster.get(getContext().system());
  
  final ClusterSingletonManagerSettings settings =
  ClusterSingletonManagerSettings.create(getContext().system()).withRole("video-content-storage-node");
  
  ClusterSingletonProxySettings proxySettings =
    ClusterSingletonProxySettings.create(getContext().system()).withRole("worker");



  //subscribe to cluster changes, MemberUp
  @Override
  public void preStart() {
    cluster.subscribe(getSelf(), MemberUp.class);
    
    context().system().actorOf(ClusterSingletonManager.props(
      Props.create(VideoStorageCoordinator.class), new PoisonPill(), settings), "video-storage-coordinator");
      
      context().system().actorOf(ClusterSingletonProxy.props("/user/video-storage-coordinator", proxySettings), "video-storage-coordinator-proxy");
  }

  //re-subscribe when restart
  @Override
  public void postStop() {
    cluster.unsubscribe(getSelf());
  }

  @Override
  public void onReceive(Object message) {
    if (message instanceof Hello) {
      Hello job = (Hello) message;
      getSender().tell(new HelloResult(), getSelf());
    }
    else {
      unhandled(message);
    }
  }

  
}<commit_msg>fixed compilation error<commit_after>package ratul.myexperiments.cluster;

import ratul.myexperiments.cluster.ClusterMsgs.*;

import akka.actor.UntypedActor;
import akka.cluster.Cluster;
import akka.cluster.ClusterEvent.CurrentClusterState;
import akka.cluster.ClusterEvent.MemberUp;
import akka.cluster.Member;
import akka.cluster.MemberStatus;
import akka.cluster.singleton.ClusterSingletonManager;
import akka.cluster.singleton.ClusterSingletonManagerSettings;
import akka.cluster.singleton.ClusterSingletonProxy;
import akka.cluster.singleton.ClusterSingletonProxySettings;
import akka.actor.Props;
import akka.actor.PoisonPill;

public class VideoContentStorageNode extends UntypedActor {

  Cluster cluster = Cluster.get(getContext().system());
  
  final ClusterSingletonManagerSettings settings =
  ClusterSingletonManagerSettings.create(getContext().system()).withRole("video-content-storage-node");
  
  ClusterSingletonProxySettings proxySettings =
    ClusterSingletonProxySettings.create(getContext().system()).withRole("video-content-storage-node");



  //subscribe to cluster changes, MemberUp
  @Override
  public void preStart() {
    cluster.subscribe(getSelf(), MemberUp.class);
    
    context().system().actorOf(ClusterSingletonManager.props(
      Props.create(VideoStorageCoordinator.class), new End(), settings), "video-storage-coordinator");
      
      context().system().actorOf(ClusterSingletonProxy.props("/user/video-storage-coordinator", proxySettings), "video-storage-coordinator-proxy");
  }
  
  public static class End {
  }

  //re-subscribe when restart
  @Override
  public void postStop() {
    cluster.unsubscribe(getSelf());
  }

  @Override
  public void onReceive(Object message) {
    if (message instanceof Hello) {
      Hello job = (Hello) message;
      getSender().tell(new HelloResult(), getSelf());
    }
    else {
      unhandled(message);
    }
  }

  
}
{'fraction_non_alphanumeric': 0.11296498905908096, 'fraction_numerical': 0.0, 'mean_word_length': 5.004926108374384, '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': '4556148', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1016, 'n_words': 180}