Exemplo n.º 1
0
 /**
  * Creates internal hive format version info.
  *
  * @throws IOException
  */
 private void createVersionInfo() throws IOException {
   final byte[] bytes = CURRENTVERSION.getBytes();
   final Tree root = new Tree(repository);
   FileTreeEntry versionFile = root.addFile(VERSION_PATH);
   versionFile.setId(writeBytes(bytes));
   Commit commit = commitTree(root);
   updateHead(commit);
 }
Exemplo n.º 2
0
 private VersionImpl updateTree(final Tree root, final String key, final byte[] data)
     throws IOException {
   ObjectId objectId = writeBytes(data);
   FileTreeEntry fileTreeEntry = root.addFile(key + "/" + objectId.name());
   fileTreeEntry.setId(objectId);
   Commit commit = commitTree(root);
   updateHead(commit);
   VersionImpl version = new VersionImpl(commit, key, fileTreeEntry);
   return version;
 }