Package eu.stratosphere.compiler

Examples of eu.stratosphere.compiler.CompilerException


          props.isPartitionedOnFields(this.partitioningFields);
    } else if (this.partitioning == PartitioningProperty.RANGE_PARTITIONED) {
      return props.getPartitioning() == PartitioningProperty.RANGE_PARTITIONED &&
          props.matchesOrderedPartitioning(this.ordering);
    } else {
      throw new CompilerException("Bug in properties matching logic.");
    }
  }
View Full Code Here


        if(this.dataDistribution != null) {
          channel.setDataDistribution(this.dataDistribution);
        }
        break;
      default:
        throw new CompilerException();
    }
  }
View Full Code Here

          break;
        case RANGE_PARTITIONED:
          estimator.addRangePartitionCost(source, to);
          break;
        default:
          throw new CompilerException();
      }
    }
  }
View Full Code Here

      // that way, later FORWARDS are more expensive than earlier forwards.
      // Note that this only applies to the heuristic costs.
     
      switch (channel.getShipStrategy()) {
      case NONE:
        throw new CompilerException(
          "Cannot determine costs: Shipping strategy has not been set for an input.");
      case FORWARD:
//        costs.addHeuristicNetworkCost(channel.getMaxDepth());
        break;
      case PARTITION_LOCAL_HASH:
        break;
      case PARTITION_RANDOM:
        addRandomPartitioningCost(channel, costs);
        break;
      case PARTITION_HASH:
        addHashPartitioningCost(channel, costs);
        break;
      case PARTITION_RANGE:
        addRangePartitionCost(channel, costs);
        break;
      case BROADCAST:
        addBroadcastCost(channel, channel.getReplicationFactor(), costs);
        break;
      default:
        throw new CompilerException("Unknown shipping strategy for input: " + channel.getShipStrategy());
      }
     
      switch (channel.getLocalStrategy()) {
      case NONE:
        break;
      case SORT:
      case COMBININGSORT:
        addLocalSortCost(channel, availableMemory, costs);
        break;
      default:
        throw new CompilerException("Unsupported local strategy for input: " + channel.getLocalStrategy());
      }
     
      if (channel.getTempMode() != null && channel.getTempMode() != TempMode.NONE) {
        addArtificialDamCost(channel, 0, costs);
      }
     
      // adjust with the cost weight factor
      if (channel.isOnDynamicPath()) {
        costs.multiplyWith(channel.getCostWeight());
      }
     
      totalCosts.addCosts(costs);
    }
   
    Channel firstInput = null;
    Channel secondInput = null;
    Costs driverCosts = new Costs();
   
    // get the inputs, if we have some
    {
      Iterator<Channel> channels = n.getInputs();
      if (channels.hasNext()) {
        firstInput = channels.next();
      }
      if (channels.hasNext()) {
        secondInput = channels.next();
      }
    }

    // determine the local costs
    switch (n.getDriverStrategy()) {
    case NONE:
    case UNARY_NO_OP:
    case BINARY_NO_OP: 
    case COLLECTOR_MAP:
    case MAP:
    case FLAT_MAP:
     
    case ALL_GROUP_REDUCE:
    case ALL_REDUCE:
      // this operations does not do any actual grouping, since every element is in the same single group
     
    case CO_GROUP:
    case SORTED_GROUP_REDUCE:
    case SORTED_REDUCE:
      // grouping or co-grouping over sorted streams for free
     
    case SORTED_GROUP_COMBINE:
      // partial grouping is always local and main memory resident. we should add a relative cpu cost at some point
   
    case UNION:
      // pipelined local union is for free
     
      break;
    case MERGE:
      addLocalMergeCost(firstInput, secondInput, availableMemory, driverCosts);
      break;
    case HYBRIDHASH_BUILD_FIRST:
      addHybridHashCosts(firstInput, secondInput, availableMemory, driverCosts);
      break;
    case HYBRIDHASH_BUILD_SECOND:
      addHybridHashCosts(secondInput, firstInput, availableMemory, driverCosts);
      break;
    case NESTEDLOOP_BLOCKED_OUTER_FIRST:
      addBlockNestedLoopsCosts(firstInput, secondInput, availableMemory, driverCosts);
      break;
    case NESTEDLOOP_BLOCKED_OUTER_SECOND:
      addBlockNestedLoopsCosts(secondInput, firstInput, availableMemory, driverCosts);
      break;
    case NESTEDLOOP_STREAMED_OUTER_FIRST:
      addStreamedNestedLoopsCosts(firstInput, secondInput, availableMemory, driverCosts);
      break;
    case NESTEDLOOP_STREAMED_OUTER_SECOND:
      addStreamedNestedLoopsCosts(secondInput, firstInput, availableMemory, driverCosts);
      break;
    default:
      throw new CompilerException("Unknown local strategy: " + n.getDriverStrategy().name());
    }
   
    // adjust with the cost weight factor
    if (n.isOnDynamicPath()) {
      driverCosts.multiplyWith(n.getCostWeight());
View Full Code Here

      } else if (Key.class.isAssignableFrom(type)) {
        @SuppressWarnings("unchecked")
        Class<? extends Key<?>> keyType = (Class<? extends Key<?>>) type;
        keyTypes[i] = keyType;
      } else {
        throw new CompilerException("The field type " + type.getName() +
            " cannot be used as a key because it does not implement the interface 'Key'");
      }
    }
   
    return keyTypes;
View Full Code Here

    int[] localPositions1 = contract.getKeyColumns(0);
    int[] localPositions2 = contract.getKeyColumns(1);
    Class<? extends Key<?>>[] types = recContract.getKeyClasses();
   
    if (localPositions1.length != localPositions2.length) {
      throw new CompilerException("Error: The keys for the first and second input have a different number of fields.");
    }
   
    for (int i = 0; i < localPositions1.length; i++) {
      input1Schema.addType(localPositions1[i], types[i]);
    }
View Full Code Here

    this.configuration = config;
   
    // instantiate the address to the job manager
    final String address = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null);
    if (address == null) {
      throw new CompilerException("Cannot find address to job manager's RPC service in the global configuration.");
    }
   
    final int port = GlobalConfiguration.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT);
    if (port < 0) {
      throw new CompilerException("Cannot find port to job manager's RPC service in the global configuration.");
    }

    final InetSocketAddress jobManagerAddress = new InetSocketAddress(address, port);
    this.compiler = new PactCompiler(new DataStatistics(), new DefaultCostEstimator(), jobManagerAddress);
   
View Full Code Here

TOP

Related Classes of eu.stratosphere.compiler.CompilerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.