Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed 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 com.facebook.presto.connector.jmx;
 
 
 
 import java.util.List;
 
 import static com.facebook.presto.util.Types.checkType;
 import static com.google.common.base.MoreObjects.toStringHelper;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 public class JmxSplitManager
         implements ConnectorSplitManager
 {
     private final String connectorId;
     private final NodeManager nodeManager;
 
     @Inject
     public JmxSplitManager(JmxConnectorId jmxConnectorIdNodeManager nodeManager)
     {
         this. = checkNotNull(jmxConnectorId"jmxConnectorId is null").toString();
         this. = checkNotNull(nodeManager"nodeManager is null");
     }
 
     @Override
     {
         checkNotNull(tupleDomain"tupleDomain is null");
         JmxTableHandle jmxTableHandle = checkType(tableJmxTableHandle.class"table");
 
         List<ConnectorPartitionpartitions = ImmutableList.<ConnectorPartition>of(new JmxPartition(jmxTableHandle));
         return new ConnectorPartitionResult(partitionstupleDomain);
     }
 
     @Override
     {
         checkNotNull(partitions"partitions is null");
         if (partitions.isEmpty()) {
             return new FixedSplitSource(, ImmutableList.<ConnectorSplit>of());
         }
 
         ConnectorPartition partition = Iterables.getOnlyElement(partitions);
         JmxTableHandle tableHandle = checkType(partitionJmxPartition.class"partition").getTableHandle();
 
         ImmutableList.Builder<ConnectorSplitsplits = ImmutableList.builder();
         for (Node node : .getActiveNodes()) {
             splits.add(new JmxSplit(tableHandle, ImmutableList.of(node.getHostAndPort())));
         }
         return new FixedSplitSource(splits.build());
     }
 
     public static class JmxPartition
             implements ConnectorPartition
     {
         private final JmxTableHandle tableHandle;
 
         public JmxPartition(JmxTableHandle tableHandle)
         {
             this. = checkNotNull(tableHandle"tableHandle is null");
         }
 
         public JmxTableHandle getTableHandle()
         {
             return ;
         }
 
         @Override
         public String getPartitionId()
         {
             return "jmx";
         }
 
        @Override
        {
            return TupleDomain.all();
        }
        @Override
        public String toString()
        {
            return toStringHelper(this)
                    .add("tableHandle")
                    .toString();
        }
    }
New to GrepCode? Check out our FAQ X