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.informationSchema;
 
 
 
 import java.util.List;
 import java.util.Map;
 
 import static com.facebook.presto.util.Types.checkType;
 import static com.google.common.base.MoreObjects.toStringHelper;
 import static com.google.common.base.Preconditions.checkNotNull;
 
         implements ConnectorSplitManager
 {
     private final NodeManager nodeManager;
 
     @Inject
     public InformationSchemaSplitManager(NodeManager nodeManager)
     {
         this. = checkNotNull(nodeManager"nodeManager is null");
     }
 
     @Override
     {
         checkNotNull(tupleDomain"tupleDomain is null");
         InformationSchemaTableHandle informationSchemaTableHandle = checkType(tableInformationSchemaTableHandle.class"table");
 
         Map<ConnectorColumnHandleSerializableNativeValuebindings = tupleDomain.extractNullableFixedValues();
 
         List<ConnectorPartitionpartitions = ImmutableList.<ConnectorPartition>of(new InformationSchemaPartition(informationSchemaTableHandlebindings));
         // We don't strip out the bindings that we have created from the undeterminedTupleDomain b/c the current InformationSchema
         // system requires that all filters be re-applied at execution time.
         return new ConnectorPartitionResult(partitionstupleDomain);
     }
 
     @Override
     {
         checkNotNull(partitions"partitions is null");
         if (partitions.isEmpty()) {
             return new FixedSplitSource(null, ImmutableList.<ConnectorSplit>of());
         }
 
         ConnectorPartition partition = Iterables.getOnlyElement(partitions);
         InformationSchemaPartition informationSchemaPartition = checkType(partitionInformationSchemaPartition.class"partition");
 
         List<HostAddresslocalAddress = ImmutableList.of(.getCurrentNode().getHostAndPort());
 
         ImmutableMap.Builder<StringSerializableNativeValuefilters = ImmutableMap.builder();
         for (Entry<ConnectorColumnHandleSerializableNativeValueentry : informationSchemaPartition.getFilters().entrySet()) {
             InformationSchemaColumnHandle informationSchemaColumnHandle = (InformationSchemaColumnHandleentry.getKey();
             filters.put(informationSchemaColumnHandle.getColumnName(), entry.getValue());
         }
 
         ConnectorSplit split = new InformationSchemaSplit(informationSchemaPartition.getTable(), filters.build(), localAddress);
 
         return new FixedSplitSource(null, ImmutableList.of(split));
     }
 
     public static class InformationSchemaPartition
             implements ConnectorPartition
     {
         private final InformationSchemaTableHandle table;
         private final Map<ConnectorColumnHandleSerializableNativeValuefilters;
 
         {
             this. = checkNotNull(table"table is null");
            this. = ImmutableMap.copyOf(checkNotNull(filters"filters is null"));
        }
        public InformationSchemaTableHandle getTable()
        {
            return ;
        }
        @Override
        public String getPartitionId()
        {
            return .getSchemaTableName().toString();
        }
        @Override
        {
            return TupleDomain.withNullableFixedValues();
        }
        {
            return ;
        }
        @Override
        public String toString()
        {
            return toStringHelper(this)
                    .add("table")
                    .add("filters")
                    .toString();
        }
    }
New to GrepCode? Check out our FAQ X