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

    https://github.com/apache/storm/pull/1642#discussion_r77527810
  
    --- Diff: storm-core/src/jvm/org/apache/storm/localizer/AsyncLocalizer.java 
---
    @@ -0,0 +1,420 @@
    +/**
    + * 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 org.apache.storm.localizer;
    +
    +import java.io.File;
    +import java.io.FileOutputStream;
    +import java.io.IOException;
    +import java.net.JarURLConnection;
    +import java.net.URL;
    +import java.util.ArrayList;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.concurrent.Callable;
    +import java.util.concurrent.ExecutorService;
    +import java.util.concurrent.Executors;
    +import java.util.concurrent.Future;
    +import java.util.concurrent.TimeUnit;
    +
    +import org.apache.commons.io.FileUtils;
    +import org.apache.storm.Config;
    +import org.apache.storm.blobstore.BlobStore;
    +import org.apache.storm.blobstore.ClientBlobStore;
    +import org.apache.storm.daemon.Shutdownable;
    +import org.apache.storm.daemon.supervisor.AdvancedFSOps;
    +import org.apache.storm.daemon.supervisor.SupervisorUtils;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.utils.ConfigUtils;
    +import org.apache.storm.utils.Utils;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import com.google.common.util.concurrent.ThreadFactoryBuilder;
    +
    +/**
    + * This is a wrapper around the Localizer class that provides the desired
    + * async interface to Slot.
    + * TODO once we have replaced the original supervisor merge this with
    + * Localizer and optimize them
    + */
    +public class AsyncLocalizer implements ILocalizer, Shutdownable {
    +    /**
    +     * A future that has already completed.
    +     */
    +    private static class AllDoneFuture implements Future<Void> {
    +
    +        @Override
    +        public boolean cancel(boolean mayInterruptIfRunning) {
    +            return false;
    +        }
    +
    +        @Override
    +        public boolean isCancelled() {
    +            return false;
    +        }
    +
    +        @Override
    +        public boolean isDone() {
    +            return true;
    +        }
    +
    +        @Override
    +        public Void get() {
    +            return null;
    +        }
    +
    +        @Override
    +        public Void get(long timeout, TimeUnit unit) {
    --- End diff --
    
    The only `@NotNull` I could find that java could be using is a sun internal 
annotation.


---
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