Examples of Partition


Examples of org.apache.geronimo.xbeans.geronimo.directory.DirPartitionDocument.Partition

        DirDirectoryConfigurationDocument doc = parse(file);
        DirectoryConfiguration dirConfig = doc.getDirectoryConfiguration();

        Partitions partitions = dirConfig.getPartitions();
        if (partitions != null) {
            Partition partitionList[] = partitions.getPartitionArray();
            if (partitionList != null) {
                Set partition = new HashSet();
                for (int i = 0; i < partitionList.length; i++) {
                    partition.add(processPartition(partitionList[i]));
                }
View Full Code Here

Examples of org.apache.giraph.partition.Partition

    );
    PartitionStore partitionStore = Mockito.mock(PartitionStore.class);
    Mockito.when(service.getPartitionStore()).thenReturn(partitionStore);
    Mockito.when(partitionStore.getPartitionIds()).thenReturn(
        Lists.newArrayList(0, 1));
    Partition partition = Mockito.mock(Partition.class);
    Mockito.when(partition.getVertexCount()).thenReturn(Long.valueOf(1));
    Mockito.when(partitionStore.getOrCreatePartition(0)).thenReturn(partition);
    Mockito.when(partitionStore.getOrCreatePartition(1)).thenReturn(partition);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.Partition

    assertNull(tblParams.get(HowlConstants.HOWL_ISD_CLASS));
    assertNull(tblParams.get(HowlConstants.HOWL_OSD_CLASS));

    List<String> partVals = new ArrayList<String>(1);
    partVals.add("2010-10-10");
    Partition part = msc.getPartition(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, partVals);

    assertEquals(RCFileInputFormat.class.getName(),part.getSd().getInputFormat());
    assertEquals(RCFileOutputFormat.class.getName(),part.getSd().getOutputFormat());

    Map<String,String> partParams = part.getParameters();
    assertEquals(RCFileInputDriver.class.getName(), partParams.get(HowlConstants.HOWL_ISD_CLASS));
    assertEquals(RCFileOutputDriver.class.getName(), partParams.get(HowlConstants.HOWL_OSD_CLASS));

    howlDriver.run("drop table junit_sem_analysis");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Partition

    validateAlterTableType(tbl, AlterTableDesc.AlterTableTypes.ADDPARTITION);

    // If the add partition was created with IF NOT EXISTS, then we should
    // not throw an error if the specified part does exist.
    Partition checkPart = db.getPartition(tbl, addPartitionDesc.getPartSpec(), false);
    if (checkPart != null && addPartitionDesc.getIfNotExists()) {
      return 0;
    }

    if (addPartitionDesc.getLocation() == null) {
      db.createPartition(tbl, addPartitionDesc.getPartSpec());
    } else {
      // set partition path relative to table
      db.createPartition(tbl, addPartitionDesc.getPartSpec(), new Path(tbl
          .getPath(), addPartitionDesc.getLocation()));
    }

    Partition part = db
        .getPartition(tbl, addPartitionDesc.getPartSpec(), false);
    work.getOutputs().add(new WriteEntity(part));

    return 0;
  }
View Full Code Here

Examples of org.apache.hadoop.zebra.types.Partition

        // set default projection that contains everything
        schema = schemaFile.getLogical();
        projection = new Projection(schema);
        String storage = schemaFile.getStorageString();
        String comparator = schemaFile.getComparator();
        partition = new Partition(schema, projection, storage, comparator);
        for (int nx = 0; nx < numCGs; nx++) {
          if (!schemaFile.isCGDeleted(nx)) {
            colGroups[nx] =
              new ColumnGroup.Reader(new Path(path, partition.getCGSchema(nx).getName()),
                                     conf, mapper);
View Full Code Here

Examples of org.apache.hadoop.zebra.types.Partition

    public synchronized void setProjection(String projection)
        throws ParseException, IOException {
      if (projection == null) {
        this.projection = new Projection(schemaFile.getLogical());
        partition =
            new Partition(schemaFile.getLogical(), this.projection, schemaFile
                .getStorageString(), schemaFile.getComparator());
      }
      else {
        /**
         * the typed schema from projection which is untyped or actually typed
         * as "bytes"
         */
        this.projection =
            new Projection(schemaFile.getLogical(), projection);
        partition =
            new Partition(schemaFile.getLogical(), this.projection, schemaFile
                .getStorageString(), schemaFile.getComparator());
      }
      inferredMapping = false;
    }
View Full Code Here

Examples of org.apache.hadoop.zebra.types.Partition

    public SchemaFile(Path path, String btSchemaStr, String btStorageStr, String sortColumns,
        String btComparator, Configuration conf)
        throws IOException {
      storage = btStorageStr;
      try {
        partition = new Partition(btSchemaStr, btStorageStr, btComparator, sortColumns);
      }
      catch (Exception e) {
        throw new IOException("Partition constructor failed :" + e.getMessage());
      }
      this.sortInfo = partition.getSortInfo();
View Full Code Here

Examples of org.apache.hadoop.zebra.types.Partition

        ;
        throw new IOException("Schema build failed :" + e.getMessage());
      }
      storage = WritableUtils.readString(in);
      try {
        partition = new Partition(logicalStr, storage, comparator);
      }
      catch (Exception e) {
        throw new IOException("Partition constructor failed :" + e.getMessage());
      }
      cgschemas = partition.getCGSchemas();
View Full Code Here

Examples of org.apache.hadoop.zebra.types.Partition

  @Test
  public void testStorageValid1() {
    try {
      String strStorage = "[c1]; [c2]";
      Partition p = new Partition(schema.toString(), strStorage, null);
      CGSchema[] cgschemas = p.getCGSchemas();

      // 2 column group;
      int size = cgschemas.length;
      Assert.assertEquals(size, 2);
      System.out.println("********** Column Groups **********");
      for (int i = 0; i < cgschemas.length; i++) {
        System.out.println(cgschemas[i]);
        System.out.println("--------------------------------");
      }
      CGSchema cgs1 = cgschemas[0];
      CGSchema cgs2 = cgschemas[1];

      ColumnSchema f11 = cgs1.getSchema().getColumn(0);
      Assert.assertEquals("c1", f11.getName());
      Assert.assertEquals(ColumnType.COLLECTION, f11.getType());
      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("c2", f21.getName());
      Assert.assertEquals(ColumnType.COLLECTION, f21.getType());

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
          .getPartitionInfo().getColMap();
      Assert.assertEquals(colmap.size(), 2);
      Iterator<Map.Entry<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>>> it = colmap
          .entrySet().iterator();
      for (int i = 0; i < colmap.size(); i++) {
View Full Code Here

Examples of org.apache.hadoop.zebra.types.Partition

  @Test
  public void testStorageValid2() {
    try {
      String strStorage = "[c1.f1]";
      Partition p = new Partition(schema.toString(), strStorage, null);
      Assert.assertTrue(false);
      CGSchema[] cgschemas = p.getCGSchemas();

      // 2 column group;
      int size = cgschemas.length;
      Assert.assertEquals(size, 2);
      System.out.println("********** Column Groups **********");
      for (int i = 0; i < cgschemas.length; i++) {
        System.out.println(cgschemas[i]);
        System.out.println("--------------------------------");
      }
      CGSchema cgs1 = cgschemas[0];
      CGSchema cgs2 = cgschemas[1];

      ColumnSchema f11 = cgs1.getSchema().getColumn(0);
      Assert.assertEquals("c1.f1", f11.getName());
      Assert.assertEquals(ColumnType.INT, f11.getType());
      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("c1.f2", f21.getName());
      Assert.assertEquals(ColumnType.INT, f21.getType());
      ColumnSchema f22 = cgs2.getSchema().getColumn(1);
      Assert.assertEquals("c2", f22.getName());
      Assert.assertEquals(ColumnType.COLLECTION, f22.getType());

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
          .getPartitionInfo().getColMap();
      Assert.assertEquals(colmap.size(), 3);
      Iterator<Map.Entry<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>>> it = colmap
          .entrySet().iterator();
      for (int i = 0; i < colmap.size(); i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.