{"action":"created","comment":{"url":"https://api.github.com/repos/mediachain/mediachain/pulls/comments/62535556","id":62535556,"diff_hunk":"@@ -0,0 +1,158 @@\n+package io.mediachain.datastore\n+\n+import com.amazonaws.auth.BasicAWSCredentials\n+import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient\n+import com.amazonaws.services.dynamodbv2.model.AttributeValue\n+import java.nio.ByteBuffer\n+import scala.collection.mutable.{Buffer, ArrayBuffer}\n+import io.mediachain.multihash.MultiHash\n+import io.mediachain.types.Datastore.DatastoreException\n+\n+// TODO error handling\n+//      queued eventual writes in the background with disk backing of \n+//       in-progress writes\n+//      use batch writes for chunked puts\n+class DynamoDatastore(table: String, creds: BasicAWSCredentials)\n+  extends BinaryDatastore with AutoCloseable {\n+  import scala.collection.JavaConversions._\n+  \n+  val chunkSize = 1024 * 384 // 384 KB; DynamoDB has 400KB limit\n+  val chunkTable = table + \"Chunks\"\n+  \n+  val db = new AmazonDynamoDBClient(creds)\n+\n+  override def put(key: MultiHash, value: Array[Byte]) {","path":"transactor/src/main/scala/io/mediachain/datastore/DynamoDatastore.scala","position":24,"original_position":24,"commit_id":"8557e50bb2b3b98d116c6f0fd47c4aba18a8ecfc","original_commit_id":"8557e50bb2b3b98d116c6f0fd47c4aba18a8ecfc","user":{"login":"vyzo","id":36426,"avatar_url":"https://avatars.githubusercontent.com/u/36426?v=3","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false},"body":"yes, the underlying implementation of the binary datastore.","created_at":"2016-05-09T17:12:06Z","updated_at":"2016-05-09T17:12:06Z","html_url":"https://github.com/mediachain/mediachain/pull/65#discussion_r62535556","pull_request_url":"https://api.github.com/repos/mediachain/mediachain/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/comments/62535556"},"html":{"href":"https://github.com/mediachain/mediachain/pull/65#discussion_r62535556"},"pull_request":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/mediachain/mediachain/pulls/65","id":69317550,"html_url":"https://github.com/mediachain/mediachain/pull/65","diff_url":"https://github.com/mediachain/mediachain/pull/65.diff","patch_url":"https://github.com/mediachain/mediachain/pull/65.patch","issue_url":"https://api.github.com/repos/mediachain/mediachain/issues/65","number":65,"state":"open","locked":false,"title":"basic datastore implementation [reset]","user":{"login":"vyzo","id":36426,"avatar_url":"https://avatars.githubusercontent.com/u/36426?v=3","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false},"body":"This is a reset branch prior to monorepo merging mess up in #56 \r\nProvides a basic implementation for datastores with Rocks and DynamoDb","created_at":"2016-05-09T09:29:15Z","updated_at":"2016-05-09T17:12:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mediachain/mediachain/pulls/65/commits","review_comments_url":"https://api.github.com/repos/mediachain/mediachain/pulls/65/comments","review_comment_url":"https://api.github.com/repos/mediachain/mediachain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mediachain/mediachain/issues/65/comments","statuses_url":"https://api.github.com/repos/mediachain/mediachain/statuses/8557e50bb2b3b98d116c6f0fd47c4aba18a8ecfc","head":{"label":"mediachain:vyzo-datastore-reset","ref":"vyzo-datastore-reset","sha":"8557e50bb2b3b98d116c6f0fd47c4aba18a8ecfc","user":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"repo":{"id":49516983,"name":"mediachain","full_name":"mediachain/mediachain","owner":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediachain/mediachain","description":"A distributed metadata protocol","fork":false,"url":"https://api.github.com/repos/mediachain/mediachain","forks_url":"https://api.github.com/repos/mediachain/mediachain/forks","keys_url":"https://api.github.com/repos/mediachain/mediachain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediachain/mediachain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediachain/mediachain/teams","hooks_url":"https://api.github.com/repos/mediachain/mediachain/hooks","issue_events_url":"https://api.github.com/repos/mediachain/mediachain/issues/events{/number}","events_url":"https://api.github.com/repos/mediachain/mediachain/events","assignees_url":"https://api.github.com/repos/mediachain/mediachain/assignees{/user}","branches_url":"https://api.github.com/repos/mediachain/mediachain/branches{/branch}","tags_url":"https://api.github.com/repos/mediachain/mediachain/tags","blobs_url":"https://api.github.com/repos/mediachain/mediachain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediachain/mediachain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediachain/mediachain/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediachain/mediachain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediachain/mediachain/statuses/{sha}","languages_url":"https://api.github.com/repos/mediachain/mediachain/languages","stargazers_url":"https://api.github.com/repos/mediachain/mediachain/stargazers","contributors_url":"https://api.github.com/repos/mediachain/mediachain/contributors","subscribers_url":"https://api.github.com/repos/mediachain/mediachain/subscribers","subscription_url":"https://api.github.com/repos/mediachain/mediachain/subscription","commits_url":"https://api.github.com/repos/mediachain/mediachain/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediachain/mediachain/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediachain/mediachain/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediachain/mediachain/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediachain/mediachain/contents/{+path}","compare_url":"https://api.github.com/repos/mediachain/mediachain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediachain/mediachain/merges","archive_url":"https://api.github.com/repos/mediachain/mediachain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediachain/mediachain/downloads","issues_url":"https://api.github.com/repos/mediachain/mediachain/issues{/number}","pulls_url":"https://api.github.com/repos/mediachain/mediachain/pulls{/number}","milestones_url":"https://api.github.com/repos/mediachain/mediachain/milestones{/number}","notifications_url":"https://api.github.com/repos/mediachain/mediachain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediachain/mediachain/labels{/name}","releases_url":"https://api.github.com/repos/mediachain/mediachain/releases{/id}","deployments_url":"https://api.github.com/repos/mediachain/mediachain/deployments","created_at":"2016-01-12T17:29:52Z","updated_at":"2016-05-09T10:09:48Z","pushed_at":"2016-05-09T14:49:10Z","git_url":"git://github.com/mediachain/mediachain.git","ssh_url":"git@github.com:mediachain/mediachain.git","clone_url":"https://github.com/mediachain/mediachain.git","svn_url":"https://github.com/mediachain/mediachain","homepage":"https://medium.com/mine-labs/mediachain-483f49cbe37a","size":1162,"stargazers_count":34,"watchers_count":34,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":22,"forks":0,"open_issues":22,"watchers":34,"default_branch":"master"}},"base":{"label":"mediachain:master","ref":"master","sha":"bf69d2e337fb438d591b004364942ac49d76456b","user":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"repo":{"id":49516983,"name":"mediachain","full_name":"mediachain/mediachain","owner":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediachain/mediachain","description":"A distributed metadata protocol","fork":false,"url":"https://api.github.com/repos/mediachain/mediachain","forks_url":"https://api.github.com/repos/mediachain/mediachain/forks","keys_url":"https://api.github.com/repos/mediachain/mediachain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediachain/mediachain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediachain/mediachain/teams","hooks_url":"https://api.github.com/repos/mediachain/mediachain/hooks","issue_events_url":"https://api.github.com/repos/mediachain/mediachain/issues/events{/number}","events_url":"https://api.github.com/repos/mediachain/mediachain/events","assignees_url":"https://api.github.com/repos/mediachain/mediachain/assignees{/user}","branches_url":"https://api.github.com/repos/mediachain/mediachain/branches{/branch}","tags_url":"https://api.github.com/repos/mediachain/mediachain/tags","blobs_url":"https://api.github.com/repos/mediachain/mediachain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediachain/mediachain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediachain/mediachain/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediachain/mediachain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediachain/mediachain/statuses/{sha}","languages_url":"https://api.github.com/repos/mediachain/mediachain/languages","stargazers_url":"https://api.github.com/repos/mediachain/mediachain/stargazers","contributors_url":"https://api.github.com/repos/mediachain/mediachain/contributors","subscribers_url":"https://api.github.com/repos/mediachain/mediachain/subscribers","subscription_url":"https://api.github.com/repos/mediachain/mediachain/subscription","commits_url":"https://api.github.com/repos/mediachain/mediachain/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediachain/mediachain/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediachain/mediachain/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediachain/mediachain/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediachain/mediachain/contents/{+path}","compare_url":"https://api.github.com/repos/mediachain/mediachain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediachain/mediachain/merges","archive_url":"https://api.github.com/repos/mediachain/mediachain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediachain/mediachain/downloads","issues_url":"https://api.github.com/repos/mediachain/mediachain/issues{/number}","pulls_url":"https://api.github.com/repos/mediachain/mediachain/pulls{/number}","milestones_url":"https://api.github.com/repos/mediachain/mediachain/milestones{/number}","notifications_url":"https://api.github.com/repos/mediachain/mediachain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediachain/mediachain/labels{/name}","releases_url":"https://api.github.com/repos/mediachain/mediachain/releases{/id}","deployments_url":"https://api.github.com/repos/mediachain/mediachain/deployments","created_at":"2016-01-12T17:29:52Z","updated_at":"2016-05-09T10:09:48Z","pushed_at":"2016-05-09T14:49:10Z","git_url":"git://github.com/mediachain/mediachain.git","ssh_url":"git@github.com:mediachain/mediachain.git","clone_url":"https://github.com/mediachain/mediachain.git","svn_url":"https://github.com/mediachain/mediachain","homepage":"https://medium.com/mine-labs/mediachain-483f49cbe37a","size":1162,"stargazers_count":34,"watchers_count":34,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":22,"forks":0,"open_issues":22,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/65"},"html":{"href":"https://github.com/mediachain/mediachain/pull/65"},"issue":{"href":"https://api.github.com/repos/mediachain/mediachain/issues/65"},"comments":{"href":"https://api.github.com/repos/mediachain/mediachain/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mediachain/mediachain/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/mediachain/mediachain/statuses/8557e50bb2b3b98d116c6f0fd47c4aba18a8ecfc"}}}}