<commit_before>#include "espresso_core.h"

int main(int argc, char** argv) {

  handle_cmd_args(argc, argv);

  load_persistent_metadata(argv[METADATA_FILE]);

  // TODO: open filesystem data for when you need it
  // filepath is argv[FILESYSTEM]

  printf("persistent metadata on %s has been loaded, ", argv[NAME_ID]);
  printf("opening espresso node to network connections\n");

  // register espresso callback functions in network layer
  register_read_data_callback(read_data);
  register_write_data_callback(write_data);
  register_delete_data_callback(delete_data);

  // the svc_main_loop function lives in network core and
  // calls registered espresso functions as it receives the rpcs
  svc_main_loop(argc, argv);

  return 0;
}

ssize_t read_data (int fd, int file_id, int stripe_id, int chunk_num, int offset, void *buf, int count) {

  printf("read_data called, espresso_core\n");
  return read_chunk(fd, file_id, stripe_id, chunk_num, offset, buf, count);
}

ssize_t write_data (int fd, int file_id, int stripe_id, int chunk_num, int offset, void *buf, int count) {

  return write_chunk(fd, file_id, stripe_id, chunk_num, offset, buf, count);
}

int delete_data (int fd, int file_id, int stripe_id, int chunk_num) {

   printf("delete_data called, espresso_core\n");
  return delete_chunk(fd, file_id, stripe_id, chunk_num);
}

void load_persistent_metadata(char* metadata_path) {

   printf("loading metadata from: %s\n", metadata_path);

   // TODO: load metadata
}

void handle_cmd_args(int argc, char** argv) {

  if (argc == NUM_EXPECTED_ARGS) {

  }
  else {
     fprintf(stderr, "%s exiting: invalid command line arguments provided", argv[0]);
     fprintf(stderr, "\nUsage: %s <id> <persistent metadata path> <data path>\n", argv[0]);
     exit(-1);
  }
}
<commit_msg>changed #defined names in espresso_core<commit_after>#include "espresso_core.h"

int main(int argc, char** argv) {

  handle_cmd_args(argc, argv);

  load_persistent_metadata(argv[METADATA]);

  // TODO: open filesystem data for when you need it
  // filepath is argv[FILESYSTEM]

  printf("persistent metadata on %s has been loaded, ", argv[NAME]);
  printf("opening espresso node to network connections\n");

  // register espresso callback functions in network layer
  register_read_data_callback(read_data);
  register_write_data_callback(write_data);
  register_delete_data_callback(delete_data);

  // the svc_main_loop function lives in network core and
  // calls registered espresso functions as it receives the rpcs
  svc_main_loop(argc, argv);

  return 0;
}

ssize_t read_data (int fd, int file_id, int stripe_id, int chunk_num, int offset, void *buf, int count) {

  printf("read_data called, espresso_core\n");
  return read_chunk(fd, file_id, stripe_id, chunk_num, offset, buf, count);
}

ssize_t write_data (int fd, int file_id, int stripe_id, int chunk_num, int offset, void *buf, int count) {

  return write_chunk(fd, file_id, stripe_id, chunk_num, offset, buf, count);
}

int delete_data (int fd, int file_id, int stripe_id, int chunk_num) {

   printf("delete_data called, espresso_core\n");
  return delete_chunk(fd, file_id, stripe_id, chunk_num);
}

void load_persistent_metadata(char* metadata_path) {

   printf("loading metadata from: %s\n", metadata_path);

   // TODO: load metadata
}

void handle_cmd_args(int argc, char** argv) {

  if (argc == NUM_EXPECTED_ARGS) {

  }
  else {
     fprintf(stderr, "%s exiting: invalid command line arguments provided", argv[0]);
     fprintf(stderr, "\nUsage: %s <id> <persistent metadata path> <data path>\n", argv[0]);
     exit(-1);
  }
}

{'fraction_non_alphanumeric': 0.1107717934480844, 'fraction_numerical': 0.002220988339811216, 'mean_word_length': 4.8019323671497585, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2257296', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1199, 'n_words': 356}