Examples of asByteArray()


Examples of org.apache.tajo.datum.Datum.asByteArray()

   */
  @Override
  public byte[] getBytes(String name) throws SQLException {
    Datum datum = cur.get(findColumn(name));
    handleNull(datum);
    return datum.asByteArray();
  }

  /*
   * (non-Javadoc)
   *
 
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

  @Override
  public Datum eval(Tuple params) {
    Datum datum = params.get(0);
    if(datum instanceof NullDatum) return NullDatum.get();

    return DatumFactory.createInt4(datum.asByteArray().length*8);
  }
}
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

    Datum datum = params.get(0);
    if(datum instanceof NullDatum) return NullDatum.get();

    try {
        MessageDigest md = MessageDigest.getInstance("MD5");
        return DatumFactory.createText(new String(Hex.encodeHex(md.digest(datum.asByteArray()))));
    } catch (NoSuchAlgorithmException e){
        return NullDatum.get();
    }
  }
}
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

      if (searchBytes[i] == ',') {
        return DatumFactory.createInt4(0);
      }
    }

    byte[] arrayData = textArray.asByteArray();
    int findingLength = finding.size();

    int posInTextArray = 0;
    int curLengthOfCandidate = 0;
    boolean matching = true;
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

    Datum datum = params.get(0);
    if(datum instanceof NullDatum) {
      return NullDatum.get();
    }

    String ret = new String(Hex.encodeHex(datum.asByteArray()));
    return DatumFactory.createText(trimZero(ret));
  }
}
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

    Datum datum = params.get(0);
    if(datum instanceof NullDatum) {
      return NullDatum.get();
    }

    return DatumFactory.createInt4(datum.asByteArray().length);
  }
}
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

  @Override
  public Datum eval(Tuple params) {
    Datum datum = params.get(0);
    if (datum instanceof NullDatum) return NullDatum.get();

    byte[] bytes = datum.asByteArray();
    if (bytes.length > 0) {
      return DatumFactory.createInt4(bytes[0]);
    } else {
      return DatumFactory.createInt4(0);
    }
View Full Code Here

Examples of org.apache.tajo.datum.Datum.asByteArray()

                Bytes.writeVLong(os, protobufDatum.asByteArray().length);
                break;
              case CHAR:
              case INET4:
              case BLOB:
                Bytes.writeVLong(os, datum.asByteArray().length);
                break;
              default:
            }

            serde.serialize(schema.getColumn(j), datum, os, nullChars);
View Full Code Here

Examples of org.apache.tajo.datum.ProtobufDatum.asByteArray()

              case TEXT:
                Bytes.writeVLong(os, datum.asTextBytes().length);
                break;
              case PROTOBUF:
                ProtobufDatum protobufDatum = (ProtobufDatum) datum;
                Bytes.writeVLong(os, protobufDatum.asByteArray().length);
                break;
              case CHAR:
              case INET4:
              case BLOB:
                Bytes.writeVLong(os, datum.asByteArray().length);
View Full Code Here

Examples of org.doomdark.uuid.UUID.asByteArray()

        UUID id = getId(obj);
        ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeByte(STORE_BYTE);
        oos.writeUTF(queue);
        oos.write(id.asByteArray());
        oos.writeObject(obj);
        oos.close();
        Packet packet = new ByteArrayPacket(baos.toByteArray());
        RecordLocation loc = journal.write(packet, false);
        synchronized (markLock) {
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.