Github user redsanket commented on a diff in the pull request:

    https://github.com/apache/storm/pull/845#discussion_r45760156
  
    --- Diff: storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java ---
    @@ -0,0 +1,446 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package backtype.storm.blobstore;
    +
    +import java.io.ByteArrayOutputStream;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.io.OutputStream;
    +import java.util.HashSet;
    +import java.util.Iterator;
    +import java.util.Map;
    +import java.util.NoSuchElementException;
    +import java.util.Set;
    +import java.util.regex.Pattern;
    +
    +import javax.security.auth.Subject;
    +
    +import backtype.storm.nimbus.NimbusInfo;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import backtype.storm.daemon.Shutdownable;
    +import backtype.storm.generated.AuthorizationException;
    +import backtype.storm.generated.KeyNotFoundException;
    +import backtype.storm.generated.KeyAlreadyExistsException;
    +import backtype.storm.generated.ReadableBlobMeta;
    +import backtype.storm.generated.SettableBlobMeta;
    +
    +/**
    + * Provides a way to store blobs that can be downloaded.
    + * Blobs must be able to be uploaded and listed from Nimbus,
    + * and downloaded from the Supervisors. It is a key value based
    + * store. Key being a string and value being the blob data.
    + *
    + * ACL checking must take place against the provided subject.
    + * If the blob store does not support Security it must validate
    + * that all ACLs set are always WORLD, everything.
    + *
    + * The users can upload their blobs through the blob store command
    + * line. The command line utilty also allows us to update,
    + * delete.
    + *
    + * Modifying the replication factor only works for HdfsBlobStore
    + * as for the LocalFsBlobStore the replication is dependent on
    + * the number of Nimbodes available.
    + */
    +public abstract class BlobStore implements Shutdownable {
    +  public static final Logger LOG = 
LoggerFactory.getLogger(BlobStore.class);
    +  private static final Pattern KEY_PATTERN = Pattern.compile("^[\\w 
\\t\\.:_-]+$");
    +  protected static final String BASE_BLOBS_DIR_NAME = "blobs";
    +
    +  /**
    +   * Allows us to initialize the blob store
    +   * @param conf The storm configuration
    +   * @param baseDir The directory path to store the blobs
    +   * @param nimbusInfo Contains the nimbus host, port and leadership 
information.
    +   */
    +  public abstract void prepare(Map conf, String baseDir, NimbusInfo 
nimbusInfo);
    +
    +  /**
    +   * Creates the blob.
    +   * @param key Key for the blob.
    +   * @param meta Metadata which contains the acls information
    +   * @param who Is the subject creating the blob.
    +   * @return AtomicOutputStream returns a stream into which the data
    +   * can be written into.
    --- End diff --
    
    @d2r addressed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to