#include "RamCloud.h"
#include <iostream>


int main(int argc, char const *argv[])
{
  RAMCloud::RamCloud cloud("tcp:host=127.0.0.1,port=12246");

  const char * kTableName = "test_table";

  cloud.createTable(kTableName);
  //debug("[+] Created table\n");

  const uint64_t tableId = cloud.getTableId(kTableName);
  //debug("[+] Opened table id %u\n", tableId);

  //write to RAMCloud, key "0" (which has the keylength 1) has the value HalloHPI
  cloud.write(tableId, "0", 1, "HalloHPI");

  RAMCloud::Buffer value;
  ramcloud->read(tableId, "0", 1, &value);
  char buffer[200];
  value.copy(0, value.getTotalLength(), buffer);

  std::cout << "Greetings from RAMCloud" << buffer << std::endl;

  return 0;
}