Examples of create()


Examples of org.apache.hadoop.hdfs.server.namenode.EditLogOutputStream.create()

      TestBKJMInjectionHandler h = new TestBKJMInjectionHandler();
      InjectionHandler.set(h);
      EditLogOutputStream bkeos = bkjm.startLogSegment(1);
      EditLogOutputStream elfos =
          new EditLogFileOutputStream(tempEditsFile, null);
      elfos.create();
      FSEditLogTestUtil.populateStreams(1, 100, bkeos, elfos);
      EditLogInputStream bkeis =
          FSEditLogTestUtil.getJournalInputStream(bkjm, 1, true);
      EditLogInputStream elfis = new EditLogFileInputStream(tempEditsFile);
      Map<String, EditLogInputStream> streamByName =

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.create()

      for (String pathStr : NON_CANONICAL_PATHS) {
        System.out.println("Creating " + pathStr + " by " + method);
        switch (method) {
        case DIRECT_NN_RPC:
          try {
            nnrpc.create(pathStr, new FsPermission((short)0755), "client",
                new EnumSetWritable<CreateFlag>(EnumSet.of(CreateFlag.CREATE)),
                true, (short)1, 128*1024*1024L);
            fail("Should have thrown exception when creating '"
                + pathStr + "'" + " by " + method);
          } catch (InvalidPathException ipe) {

Examples of org.apache.hadoop.hdfs.web.WebHdfsFileSystem.create()

      Assert.assertEquals(webhdfs.getUri() + "/user/" + PROXY_USER, responsePath.toString());
    }

    final Path f = new Path("/testWebHdfsDoAs/a.txt");
    {
      FSDataOutputStream out = webhdfs.create(f);
      out.write("Hello, webhdfs user!".getBytes());
      out.close();
 
      final FileStatus status = webhdfs.getFileStatus(f);
      WebHdfsTestUtil.LOG.info("status.getOwner()=" + status.getOwner());

Examples of org.apache.hadoop.hive.serde2.objectinspector.SettableListObjectInspector.create()

    case LIST:
      ListObjectInspector fromLoi = (ListObjectInspector) fromOi;
      List<?> fromList = fromLoi.getList(from);
     
      SettableListObjectInspector toLoi = (SettableListObjectInspector) toOi;
      to = toLoi.create(fromList.size()); // do not reuse
      for (int i = 0; i < fromList.size(); i++) {
        Object converted = convert(fromList.get(i),
            fromLoi.getListElementObjectInspector(),
            toLoi.getListElementObjectInspector());
        toLoi.set(to, i, converted);

Examples of org.apache.hadoop.hive.serde2.objectinspector.SettableMapObjectInspector.create()

      }
      return to;
    case MAP:
      MapObjectInspector fromMoi = (MapObjectInspector) fromOi;
      SettableMapObjectInspector toMoi = (SettableMapObjectInspector) toOi;
      to = toMoi.create(); // do not reuse
      for (Map.Entry<?, ?> entry : fromMoi.getMap(from).entrySet()) {
        Object convertedKey = convert(entry.getKey(),
            fromMoi.getMapKeyObjectInspector(),
            toMoi.getMapKeyObjectInspector());
        Object convertedValue = convert(entry.getValue(),

Examples of org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector.create()

   */
  public static OrcStruct createOrcStruct(TypeInfo typeInfo, Object... objs) {
    SettableStructObjectInspector oi = (SettableStructObjectInspector) OrcStruct
        .createObjectInspector(typeInfo);
    List<StructField> fields = (List<StructField>) oi.getAllStructFieldRefs();
    OrcStruct result = (OrcStruct) oi.create();
    result.setNumFields(fields.size());
    for (int i = 0; i < fields.size(); i++) {
      oi.setStructFieldData(result, fields.get(i), objs[i]);
    }
    return result;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaBooleanObjectInspector.create()

    boolean booleanValue = true;
    baos.reset();
    JavaBooleanObjectInspector booleanOI = (JavaBooleanObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.BOOLEAN_TYPE_NAME));
    LazyUtils.writePrimitive(baos, booleanOI.create(booleanValue), booleanOI);
    m.put(cfBytes, "boolean".getBytes(), baos.toByteArray());

    // tinyint
    byte tinyintValue = -127;
    baos.reset();

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaDateObjectInspector.create()

    Date dateValue = dateWritable.get();
    baos.reset();
    JavaDateObjectInspector dateOI = (JavaDateObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.DATE_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, dateOI.create(dateValue), dateOI, false, (byte) 0, null);
    m.put(cfBytes, "date".getBytes(), baos.toByteArray());

    // timestamp
    Timestamp timestampValue = new Timestamp(now.getTime());
    baos.reset();

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaHiveCharObjectInspector.create()

    // char
    baos.reset();
    HiveChar charValue = new HiveChar("char", 4);
    JavaHiveCharObjectInspector charOI = (JavaHiveCharObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(new CharTypeInfo(4));
    LazyUtils.writePrimitiveUTF8(baos, charOI.create(charValue), charOI, false, (byte) 0, null);
    m.put(cfBytes, "char".getBytes(), baos.toByteArray());

    baos.reset();
    HiveVarchar varcharValue = new HiveVarchar("varchar", 7);
    JavaHiveVarcharObjectInspector varcharOI = (JavaHiveVarcharObjectInspector) PrimitiveObjectInspectorFactory

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaHiveDecimalObjectInspector.create()

    // decimal
    HiveDecimal decimalValue = HiveDecimal.create("1.23");
    baos.reset();
    JavaHiveDecimalObjectInspector decimalOI = (JavaHiveDecimalObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(new DecimalTypeInfo(5, 2));
    LazyUtils.writePrimitiveUTF8(baos, decimalOI.create(decimalValue), decimalOI, false, (byte) 0,
        null);
    m.put(cfBytes, "decimal".getBytes(), baos.toByteArray());

    // date
    Date now = new Date(System.currentTimeMillis());
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.