GitHub PullRequestReviewCommentEvent at 2014-05-09 13:20:19
Repository: nexus-oss
Actor: mcculls
Payload: {"comment":{"url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments/12474669","id":12474669,"diff_hunk":"@@ -0,0 +1,289 @@\n+/*\n+ * Sonatype Nexus (TM) Open Source Version\n+ * Copyright (c) 2007-2014 Sonatype, Inc.\n+ * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.\n+ *\n+ * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,\n+ * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.\n+ *\n+ * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. \"Sonatype\" and \"Sonatype Nexus\" are trademarks\n+ * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the\n+ * Eclipse Foundation. All other trademarks are the property of their respective owners.\n+ */\n+package org.sonatype.nexus.blobstore.file.kazuki;\n+\n+import java.util.Iterator;\n+import java.util.List;\n+\n+import javax.annotation.Nullable;\n+import javax.inject.Inject;\n+import javax.inject.Named;\n+\n+import org.sonatype.nexus.blobstore.api.BlobId;\n+import org.sonatype.nexus.blobstore.api.BlobMetrics;\n+import org.sonatype.nexus.blobstore.api.BlobStoreException;\n+import org.sonatype.nexus.blobstore.file.BlobMetadata;\n+import org.sonatype.nexus.blobstore.file.BlobMetadataStore;\n+import org.sonatype.nexus.blobstore.file.MetadataMetrics;\n+import org.sonatype.nexus.blobstore.file.State;\n+import org.sonatype.sisu.goodies.lifecycle.LifecycleSupport;\n+\n+import io.kazuki.v0.store.KazukiException;\n+import io.kazuki.v0.store.Key;\n+import io.kazuki.v0.store.index.SecondaryIndexStore;\n+import io.kazuki.v0.store.index.query.QueryBuilder;\n+import io.kazuki.v0.store.index.query.QueryOperator;\n+import io.kazuki.v0.store.index.query.QueryTerm;\n+import io.kazuki.v0.store.index.query.ValueType;\n+import io.kazuki.v0.store.keyvalue.KeyValueIterable;\n+import io.kazuki.v0.store.keyvalue.KeyValueIterator;\n+import io.kazuki.v0.store.keyvalue.KeyValueStore;\n+import io.kazuki.v0.store.keyvalue.KeyValueStoreIteration.SortDirection;\n+import io.kazuki.v0.store.lifecycle.Lifecycle;\n+import io.kazuki.v0.store.schema.SchemaStore;\n+import io.kazuki.v0.store.schema.TypeValidation;\n+import io.kazuki.v0.store.schema.model.Attribute.Type;\n+import io.kazuki.v0.store.schema.model.AttributeTransform;\n+import io.kazuki.v0.store.schema.model.IndexAttribute;\n+import io.kazuki.v0.store.schema.model.Schema;\n+import io.kazuki.v0.store.sequence.KeyImpl;\n+\n+import static com.google.common.base.Preconditions.checkNotNull;\n+import static java.util.Arrays.asList;\n+\n+/**\n+ * A Kazuki-backed implementation of the {@link BlobMetadataStore}.\n+ *\n+ * TODO: Consider using Kazuki's metadata keys as the blob IDs, as that would really, really simplify searching.\n+ *\n+ * @since 3.0\n+ */\n+public class KazukiBlobMetadataStore\n+    extends LifecycleSupport\n+    implements BlobMetadataStore\n+{\n+  /**\n+   * A secondary index making it possible to search by blob ID.\n+   */\n+  private static final String BLOB_ID_INDEX = \"uniqueBlobIdIndex\";\n+\n+  /**\n+   * A secondary index to facilitate searching by blob state.\n+   */\n+  private static final String STATE_INDEX = \"stateIndex\";\n+\n+  public static final String METADATA_TYPE = \"blobdata\";\n+\n+  private Lifecycle lifecycle;","path":"components/nexus-blobstore-file/src/main/java/org/sonatype/nexus/blobstore/file/kazuki/KazukiBlobMetadataStore.java","position":77,"original_position":77,"commit_id":"c7695f2bf51c8d0d32e2182ba5537b076ec4b429","original_commit_id":"c7695f2bf51c8d0d32e2182ba5537b076ec4b429","user":{"login":"mcculls","id":145851,"avatar_url":"https://avatars.githubusercontent.com/u/145851?","gravatar_id":"b8e158ed9809ee4d9ce330b8752c26e9","url":"https://api.github.com/users/mcculls","html_url":"https://github.com/mcculls","followers_url":"https://api.github.com/users/mcculls/followers","following_url":"https://api.github.com/users/mcculls/following{/other_user}","gists_url":"https://api.github.com/users/mcculls/gists{/gist_id}","starred_url":"https://api.github.com/users/mcculls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcculls/subscriptions","organizations_url":"https://api.github.com/users/mcculls/orgs","repos_url":"https://api.github.com/users/mcculls/repos","events_url":"https://api.github.com/users/mcculls/events{/privacy}","received_events_url":"https://api.github.com/users/mcculls/received_events","type":"User","site_admin":false},"body":"`final` for any immutable fields :)","created_at":"2014-05-09T13:20:19Z","updated_at":"2014-05-09T13:20:19Z","html_url":"https://github.com/sonatype/nexus-oss/pull/511#discussion_r12474669","pull_request_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/511","_links":{"self":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments/12474669"},"html":{"href":"https://github.com/sonatype/nexus-oss/pull/511#discussion_r12474669"},"pull_request":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/511"}}}}