{"action":"created","comment":{"url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments/57427187","id":57427187,"diff_hunk":"@@ -0,0 +1,101 @@\n+/**\n+ *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,\n+ *     University of Wisconsin—Madison.\n+ *\n+ *   Licensed under the Apache License, Version 2.0 (the \"License\");\n+ *   you may not use this file except in compliance with the License.\n+ *   You may obtain a copy of the License at\n+ *\n+ *       http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ *   Unless required by applicable law or agreed to in writing, software\n+ *   distributed under the License is distributed on an \"AS IS\" BASIS,\n+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ *   See the License for the specific language governing permissions and\n+ *   limitations under the License.\n+ **/\n+\n+#include \"catalog/IndexScheme.hpp\"\n+\n+#include <memory>\n+#include <string>\n+#include <unordered_map>\n+#include <utility>\n+#include <vector>\n+\n+#include \"catalog/Catalog.pb.h\"\n+#include \"catalog/CatalogTypedefs.hpp\"\n+#include \"storage/StorageBlockInfo.hpp\"\n+#include \"threading/SpinSharedMutex.hpp\"\n+#include \"types/TypedValue.hpp\"\n+#include \"types/operations/comparisons/Comparison.hpp\"\n+#include \"types/operations/comparisons/LessComparison.hpp\"\n+#include \"utility/Macros.hpp\"\n+\n+#include \"glog/logging.h\"\n+\n+namespace quickstep {\n+\n+bool IndexScheme::ProtoIsValid(const serialization::IndexScheme &proto) {\n+  // Check that proto is fully initialized.\n+  if (!proto.IsInitialized()) {\n+    return false;\n+  }\n+\n+  // Check that each index entry contains initialized valid index descriptions.\n+  for (int i = 0; i < proto.index_entries_size(); ++i) {\n+    const serialization::IndexScheme_IndexEntry &index_entry = proto.index_entries(i);\n+    for (int j = 0; j < index_entry.index_description_size(); ++j) {\n+      const IndexSubBlockDescription &index_description = index_entry.index_description(j);\n+      if (!index_description.IsInitialized()) {","path":"catalog/IndexScheme.cpp","position":null,"original_position":50,"commit_id":"0f1ccee1291b49e32d127bafa91897b59c62a8b7","original_commit_id":"db7f3a1b992490258f4d0b515adf092eef6cd81d","user":{"login":"saketj","id":3624476,"avatar_url":"https://avatars.githubusercontent.com/u/3624476?v=3","gravatar_id":"","url":"https://api.github.com/users/saketj","html_url":"https://github.com/saketj","followers_url":"https://api.github.com/users/saketj/followers","following_url":"https://api.github.com/users/saketj/following{/other_user}","gists_url":"https://api.github.com/users/saketj/gists{/gist_id}","starred_url":"https://api.github.com/users/saketj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saketj/subscriptions","organizations_url":"https://api.github.com/users/saketj/orgs","repos_url":"https://api.github.com/users/saketj/repos","events_url":"https://api.github.com/users/saketj/events{/privacy}","received_events_url":"https://api.github.com/users/saketj/received_events","type":"User","site_admin":false},"body":"Added a separate Factory implementation to check for index description validity.","created_at":"2016-03-25T08:21:45Z","updated_at":"2016-03-25T08:21:45Z","html_url":"https://github.com/pivotalsoftware/quickstep/pull/69#discussion_r57427187","pull_request_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments/57427187"},"html":{"href":"https://github.com/pivotalsoftware/quickstep/pull/69#discussion_r57427187"},"pull_request":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69","id":61910618,"html_url":"https://github.com/pivotalsoftware/quickstep/pull/69","diff_url":"https://github.com/pivotalsoftware/quickstep/pull/69.diff","patch_url":"https://github.com/pivotalsoftware/quickstep/pull/69.patch","issue_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/69","number":69,"state":"open","locked":false,"title":"CREATE INDEX now saves a new index and its properties in the catalog","user":{"login":"saketj","id":3624476,"avatar_url":"https://avatars.githubusercontent.com/u/3624476?v=3","gravatar_id":"","url":"https://api.github.com/users/saketj","html_url":"https://github.com/saketj","followers_url":"https://api.github.com/users/saketj/followers","following_url":"https://api.github.com/users/saketj/following{/other_user}","gists_url":"https://api.github.com/users/saketj/gists{/gist_id}","starred_url":"https://api.github.com/users/saketj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saketj/subscriptions","organizations_url":"https://api.github.com/users/saketj/orgs","repos_url":"https://api.github.com/users/saketj/repos","events_url":"https://api.github.com/users/saketj/events{/privacy}","received_events_url":"https://api.github.com/users/saketj/received_events","type":"User","site_admin":false},"body":"This is the final PR towards CREATE INDEX implementation in Quickstep that saves newly created indices and their properties in the catalog. \r\nThe CatalogProto has been modified to define a new message type- 'IndexScheme', which contains the set of indices defined on the relation. Within the index scheme, each index is represented as an IndexEntry that contains a string index_name, and an associated protobuf IndexSubBlockDescription. \r\n\r\nAddition of an index creates an IndexEntry in the catalog and also adds a new index sub block to the StorageBlockLayout. Duplicate indices can be checked by going through a map of indices maintained by the catalog. The PR also adds support for flexible parsing and definition of any number of properties on a given index. \r\n\r\n","created_at":"2016-03-07T12:28:16Z","updated_at":"2016-03-25T08:21:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2859cab7e4fc7b6b657528dd242d0fca0f71d43","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69/commits","review_comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69/comments","review_comment_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/69/comments","statuses_url":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/0f1ccee1291b49e32d127bafa91897b59c62a8b7","head":{"label":"pivotalsoftware:index-properties-resolver","ref":"index-properties-resolver","sha":"0f1ccee1291b49e32d127bafa91897b59c62a8b7","user":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":45578105,"name":"quickstep","full_name":"pivotalsoftware/quickstep","owner":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pivotalsoftware/quickstep","description":"Quickstep Project","fork":false,"url":"https://api.github.com/repos/pivotalsoftware/quickstep","forks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/forks","keys_url":"https://api.github.com/repos/pivotalsoftware/quickstep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pivotalsoftware/quickstep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pivotalsoftware/quickstep/teams","hooks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/hooks","issue_events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/events{/number}","events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/events","assignees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/assignees{/user}","branches_url":"https://api.github.com/repos/pivotalsoftware/quickstep/branches{/branch}","tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/tags","blobs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/refs{/sha}","trees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/{sha}","languages_url":"https://api.github.com/repos/pivotalsoftware/quickstep/languages","stargazers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/stargazers","contributors_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contributors","subscribers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscribers","subscription_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscription","commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/commits{/sha}","git_commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/commits{/sha}","comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/comments{/number}","issue_comment_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/comments{/number}","contents_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contents/{+path}","compare_url":"https://api.github.com/repos/pivotalsoftware/quickstep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pivotalsoftware/quickstep/merges","archive_url":"https://api.github.com/repos/pivotalsoftware/quickstep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pivotalsoftware/quickstep/downloads","issues_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues{/number}","pulls_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls{/number}","milestones_url":"https://api.github.com/repos/pivotalsoftware/quickstep/milestones{/number}","notifications_url":"https://api.github.com/repos/pivotalsoftware/quickstep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pivotalsoftware/quickstep/labels{/name}","releases_url":"https://api.github.com/repos/pivotalsoftware/quickstep/releases{/id}","deployments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/deployments","created_at":"2015-11-05T01:06:50Z","updated_at":"2016-03-23T08:10:36Z","pushed_at":"2016-03-25T08:18:40Z","git_url":"git://github.com/pivotalsoftware/quickstep.git","ssh_url":"git@github.com:pivotalsoftware/quickstep.git","clone_url":"https://github.com/pivotalsoftware/quickstep.git","svn_url":"https://github.com/pivotalsoftware/quickstep","homepage":null,"size":7433,"stargazers_count":11,"watchers_count":11,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":14,"forks":8,"open_issues":14,"watchers":11,"default_branch":"master"}},"base":{"label":"pivotalsoftware:master","ref":"master","sha":"11b51acc920a76d6272b1cdbc7899c0c8681a95a","user":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":45578105,"name":"quickstep","full_name":"pivotalsoftware/quickstep","owner":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pivotalsoftware/quickstep","description":"Quickstep Project","fork":false,"url":"https://api.github.com/repos/pivotalsoftware/quickstep","forks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/forks","keys_url":"https://api.github.com/repos/pivotalsoftware/quickstep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pivotalsoftware/quickstep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pivotalsoftware/quickstep/teams","hooks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/hooks","issue_events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/events{/number}","events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/events","assignees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/assignees{/user}","branches_url":"https://api.github.com/repos/pivotalsoftware/quickstep/branches{/branch}","tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/tags","blobs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/refs{/sha}","trees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/{sha}","languages_url":"https://api.github.com/repos/pivotalsoftware/quickstep/languages","stargazers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/stargazers","contributors_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contributors","subscribers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscribers","subscription_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscription","commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/commits{/sha}","git_commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/commits{/sha}","comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/comments{/number}","issue_comment_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/comments{/number}","contents_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contents/{+path}","compare_url":"https://api.github.com/repos/pivotalsoftware/quickstep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pivotalsoftware/quickstep/merges","archive_url":"https://api.github.com/repos/pivotalsoftware/quickstep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pivotalsoftware/quickstep/downloads","issues_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues{/number}","pulls_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls{/number}","milestones_url":"https://api.github.com/repos/pivotalsoftware/quickstep/milestones{/number}","notifications_url":"https://api.github.com/repos/pivotalsoftware/quickstep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pivotalsoftware/quickstep/labels{/name}","releases_url":"https://api.github.com/repos/pivotalsoftware/quickstep/releases{/id}","deployments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/deployments","created_at":"2015-11-05T01:06:50Z","updated_at":"2016-03-23T08:10:36Z","pushed_at":"2016-03-25T08:18:40Z","git_url":"git://github.com/pivotalsoftware/quickstep.git","ssh_url":"git@github.com:pivotalsoftware/quickstep.git","clone_url":"https://github.com/pivotalsoftware/quickstep.git","svn_url":"https://github.com/pivotalsoftware/quickstep","homepage":null,"size":7433,"stargazers_count":11,"watchers_count":11,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":14,"forks":8,"open_issues":14,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69"},"html":{"href":"https://github.com/pivotalsoftware/quickstep/pull/69"},"issue":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/69"},"comments":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/0f1ccee1291b49e32d127bafa91897b59c62a8b7"}}}}