<commit_before># Benchmark to test HBase installation and configurations
source_file "$ALOJA_REPO_PATH/shell/common/common_hbase.sh"
set_hbase_requires

source_file "$ALOJA_REPO_PATH/shell/common/common_ycsb.sh"
set_ycsb_requires

#BENCH_REQUIRED_FILES["tpch-hive"]="$ALOJA_PUBLIC_HTTP/aplic2/tarballs/tpch-hive.tar.gz"
#[ ! "$BENCH_LIST" ] && BENCH_LIST="hbase_ycsb_a hbase_ycsb_b hbase_ycsb_c"
[ ! "$BENCH_LIST" ] && BENCH_LIST="hbase_ycsb_a"

# Implement only the different functionality

benchmark_suite_config() {
  initialize_hadoop_vars
  prepare_hadoop_config "$NET" "$DISK" "$BENCH_SUITE"
  start_hadoop

  initialize_hbase_vars
  prepare_hbase_config "$HBASE_SETTINGS_FILE" "$HBASE_SETTINGS_FILE_PATH"
  start_hbase

  initialize_ycsb_vars
  #prepare_ycsb_config
}

benchmark_suite_cleanup() {
  clean_hbase
  clean_hadoop
}

benchmark_prepare_hbase_ycsb_a(){
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  nsplits=$(( $numberOfNodes * 10 ))  # HBase recommends (10 * number of regionservers)

  execute_hbase "$bench_name" "hbase shell -n <<< \"n_splits = $nsplits; create \\\"usertable\\\", \\\"family\\\", {SPLITS => (1..n_splits).map {|i| \\\"user#{1000+i*(9999-1000)/n_splits}\\\"}};\""

  execute_ycsb "$bench_name" "ycsb load hbase098 -P workloads/workloada -cp ${HBASE_CONF_DIR} -p recordcount=${BENCH_DATA_SIZE} -p target=${YCSB_OPERATIONCOUNT} -p threadcount=1 -p table=usertable -p columnfamily=family -s"

}

benchmark_hbase_ycsb_a() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_ycsb "$bench_name" "ycsb run hbase098 -P workloads/workloada -cp ${HBASE_CONF_DIR} -p recordcount=${BENCH_DATA_SIZE} -p target=${YCSB_OPERATIONCOUNT} -p threadcount=1 -p table=usertable -p columnfamily=family -s"

}

benchmark_hbase_insert() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_hbase "$bench_name" "hbase shell -n <<< \"put \\\"usertable\\\",\\\"row1\\\",\\\"family:testcol\\\",\\\"42\\\";\"" "time"
}

benchmark_hbase_drop() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_hbase "$bench_name" "hbase shell -n <<< \"disable \\\"usertable\\\"; drop \\\"usertable\\\";\"" "time"
}
<commit_msg>set ycsb workload sequence<commit_after># Benchmark to test HBase installation and configurations
source_file "$ALOJA_REPO_PATH/shell/common/common_hbase.sh"
set_hbase_requires

source_file "$ALOJA_REPO_PATH/shell/common/common_ycsb.sh"
set_ycsb_requires

#BENCH_REQUIRED_FILES["tpch-hive"]="$ALOJA_PUBLIC_HTTP/aplic2/tarballs/tpch-hive.tar.gz"
[ ! "$BENCH_LIST" ] && BENCH_LIST="hbase_ycsb_a hbase_ycsb_b hbase_ycsb_c hbase_ycsb_f hbase_ycsb_d hbase_ycsb_e"

#Load the database, using workload A’s parameter file (workloads/workloada) and the "-load" switch to the client.
#Run workload A (using workloads/workloada and "-t") for a variety of throughputs.
#Run workload B (using workloads/workloadb and "-t") for a variety of throughputs.
#Run workload C (using workloads/workloadc and "-t") for a variety of throughputs.
#Run workload F (using workloads/workloadf and "-t") for a variety of throughputs.
#Run workload D (using workloads/workloadd and "-t") for a variety of throughputs. This workload inserts records, increasing the size of the database.
#Delete the data in the database.
#Reload the database, using workload E’s parameter file (workloads/workloade) and the "-load switch to the client.
#Run workload E (using workloads/workloade and "-t") for a variety of throughputs. This workload inserts records, increasing the size of the database.

benchmark_suite_config() {
  initialize_hadoop_vars
  prepare_hadoop_config "$NET" "$DISK" "$BENCH_SUITE"
  start_hadoop

  initialize_hbase_vars
  prepare_hbase_config "$HBASE_SETTINGS_FILE" "$HBASE_SETTINGS_FILE_PATH"
  start_hbase

  initialize_ycsb_vars
  #prepare_ycsb_config
}

benchmark_suite_cleanup() {
  clean_hbase
  clean_hadoop
}

benchmark_hbase_ycsb_x(){

  local bench_name=$1
  local workload=$2

  execute_ycsb "$bench_name" "ycsb run hbase098 -P workloads/workload${workload} -cp ${HBASE_CONF_DIR} -p recordcount=${BENCH_DATA_SIZE} -p target=${YCSB_OPERATIONCOUNT} -p threadcount=1 -p table=usertable -p columnfamily=family -s"
}

benchmark_prepare_hbase_ycsb_a(){
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  nsplits=$(( $numberOfNodes * 10 ))  # HBase recommends (10 * number of regionservers)

  execute_hbase "$bench_name" "hbase shell -n <<< \"n_splits = $nsplits; create \\\"usertable\\\", \\\"family\\\", {SPLITS => (1..n_splits).map {|i| \\\"user#{1000+i*(9999-1000)/n_splits}\\\"}};\""

  execute_ycsb "$bench_name" "ycsb load hbase098 -P workloads/workloada -cp ${HBASE_CONF_DIR} -p recordcount=${BENCH_DATA_SIZE} -p target=${YCSB_OPERATIONCOUNT} -p threadcount=1 -p table=usertable -p columnfamily=family -s"

}

benchmark_prepare_hbase_ycsb_e(){
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_hbase "$bench_name" "hbase shell -n <<< \"disable \\\"usertable\\\"; drop \\\"usertable\\\";\""

  nsplits=$(( $numberOfNodes * 10 ))  # HBase recommends (10 * number of regionservers)

  execute_hbase "$bench_name" "hbase shell -n <<< \"n_splits = $nsplits; create \\\"usertable\\\", \\\"family\\\", {SPLITS => (1..n_splits).map {|i| \\\"user#{1000+i*(9999-1000)/n_splits}\\\"}};\""

  execute_ycsb "$bench_name" "ycsb load hbase098 -P workloads/workloade -cp ${HBASE_CONF_DIR} -p recordcount=${BENCH_DATA_SIZE} -p target=${YCSB_OPERATIONCOUNT} -p threadcount=1 -p table=usertable -p columnfamily=family -s"

}

benchmark_hbase_ycsb_a() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  benchmark_hbase_ycsb_x "$bench_name" a
}

benchmark_hbase_ycsb_b() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  benchmark_hbase_ycsb_x "$bench_name" b
}

benchmark_hbase_ycsb_c() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  benchmark_hbase_ycsb_x "$bench_name" c
}

benchmark_hbase_ycsb_d() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  benchmark_hbase_ycsb_x "$bench_name" d
}

benchmark_hbase_ycsb_e() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  benchmark_hbase_ycsb_x "$bench_name" e
}

benchmark_hbase_ycsb_f() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  benchmark_hbase_ycsb_x "$bench_name" f
}

{'fraction_non_alphanumeric': 0.14582705634227178, 'fraction_numerical': 0.013558300692979813, 'mean_word_length': 5.573267326732673, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 6, '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': '4652444', 'n_tokens_mistral': 2641, 'n_tokens_neox': 2524, 'n_words': 518}