<commit_before>
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
JAR=$DIR/target/stram-0.1-SNAPSHOT.jar
HADOOP_CLASSPATH=$DIR/../bufferserver/target/*:$DIR/target/*

#kryo dependencies
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/com/esotericsoftware/kryo/kryo/2.16/kryo-2.16.jar:~/.m2/repository/com/esotericsoftware/reflectasm/reflectasm/1.06/reflectasm-1.06-shaded.jar
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/org/mockito/mockito-all/1.8.5/mockito-all-1.8.5.jar
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/com/esotericsoftware/minlog/minlog/1.2/minlog-1.2.jar
export HADOOP_CLASSPATH

export HADOOP_CLIENT_OPTS="-Dstram.libjars=$DIR/target/stram-0.1-SNAPSHOT-tests.jar $HADOOP_OPTS"
$HADOOP_PREFIX/bin/hadoop jar $JAR com.malhartech.stram.StramClient --debug --container_memory 64 --master_memory 256 --num_containers 2 --topologyProperties $DIR/src/main/java/com/malhartech/example/wordcount/topology.properties
<commit_msg>made the runstram script generic and introduced two topology files<commit_after>#!/bin/bash

function pick_one
{
  FILES=$(ls $1 2>/dev/null)

  i=0
  TEXT="0. None\n"
  for file in $FILES
  do
    i=$[ i + 1]
    TEXT="$TEXT$i. $file\n";
  done

  FILE=""
  while test -z $FILE
  do
    case $i in
      0) echo No suitable files to pick\!
	 exit 2
	 ;;
      1) FILE=$FILES
	 ;;
      *) echo -ne $TEXT
	 echo -n "Pick a file? "
	 read res
	 if test "$res" -le "$i"
	 then
	   for file in $FILES
	   do
	     if test "$res" -eq "1"
	     then
		FILE=$file
		break
	     fi
	     res=$[ res - 1]
	   done
	 fi
    esac
  done
  eval "$2=$FILE"
}

HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/com/malhartech/bufferserver/0.1-SNAPSHOT/bufferserver-0.1-SNAPSHOT.jar
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/com/malhar/app/stram/0.1-SNAPSHOT/stram-0.1-SNAPSHOT.jar

#kryo dependencies
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/com/esotericsoftware/kryo/kryo/2.16/kryo-2.16.jar:~/.m2/repository/com/esotericsoftware/reflectasm/reflectasm/1.06/reflectasm-1.06-shaded.jar
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/org/mockito/mockito-all/1.8.5/mockito-all-1.8.5.jar
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:~/.m2/repository/com/esotericsoftware/minlog/minlog/1.2/minlog-1.2.jar

export HADOOP_CLASSPATH
export HADOOP_CLIENT_OPTS=" $HADOOP_OPTS"

PROJECT=$1
JAR="$PROJECT/target/*.jar"
pick_one "$JAR" JAR

TPLG="$PROJECT/src/main/resources/*.tplg.properties $PROJECT/src/test/resources/*.tplg.properties"
pick_one "$TPLG" TPLG

$HADOOP_PREFIX/bin/hadoop jar "$JAR" com.malhartech.stram.StramClient --debug --container_memory 64 --master_memory 256 --num_containers 2 --topologyProperties "$TPLG"

{'fraction_non_alphanumeric': 0.1548771407297096, 'fraction_numerical': 0.033879374534623974, 'mean_word_length': 4.118095238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '464460', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1165, 'n_words': 155}