Tabnine Logo
ATypeTag.serialize
Code IndexAdd Tabnine to your IDE (free)

How to use
serialize
method
in
org.apache.asterix.om.types.ATypeTag

Best Java code snippets using org.apache.asterix.om.types.ATypeTag.serialize (Showing top 20 results out of 315)

origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  long targetValue = convertType(data, start);
  out.writeByte(ATypeTag.BIGINT.serialize());
  out.writeLong(targetValue);
}
origin: apache/asterixdb

public static int getNumberOfItems(byte[] serOrderedList, int offset) {
  if (serOrderedList[offset] == ATypeTag.ARRAY.serialize()) {
    // 6 = tag (1) + itemTag (1) + list size (4)
    return AInt32SerializerDeserializer.getInt(serOrderedList, offset + 6);
  } else {
    return -1;
  }
}
origin: apache/asterixdb

public static int getStartSize(byte[] data, int start) {
  if (getIntervalTimeType(data, start) == ATypeTag.DATETIME.serialize()) {
    return Long.BYTES;
  } else {
    return Integer.BYTES;
  }
}
origin: apache/asterixdb

public boolean isTyped() {
  if (getType() != ATypeTag.ANY.serialize()) {
    return true;
  }
  return false;
}
origin: apache/asterixdb

public static int getNumberOfItems(byte[] serOrderedList, int offset) {
  if (serOrderedList[offset] == ATypeTag.MULTISET.serialize()) {
    // 6 = tag (1) + itemTag (1) + list size (4)
    return AInt32SerializerDeserializer.getInt(serOrderedList, offset + 6);
  } else {
    return -1;
  }
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  int targetValue = convertType(data, start);
  out.writeByte(ATypeTag.INTEGER.serialize());
  out.writeInt(targetValue);
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  double sourceValue = DoublePointable.getDouble(data, start);
  byte targetValue = convert(sourceValue);
  out.writeByte(ATypeTag.TINYINT.serialize());
  out.writeByte(targetValue);
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  float sourceValue = FloatPointable.getFloat(data, start);
  byte targetValue = convert(sourceValue);
  out.writeByte(ATypeTag.TINYINT.serialize());
  out.writeByte(targetValue);
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  double sourceValue = DoublePointable.getDouble(data, start);
  float targetValue = convert(sourceValue);
  out.writeByte(ATypeTag.FLOAT.serialize());
  out.writeFloat(targetValue);
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  float sourceValue = FloatPointable.getFloat(data, start);
  short targetValue = convert(sourceValue);
  out.writeByte(ATypeTag.SMALLINT.serialize());
  out.writeShort(targetValue);
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  double sourceValue = DoublePointable.getDouble(data, start);
  short targetValue = convert(sourceValue);
  out.writeByte(ATypeTag.SMALLINT.serialize());
  out.writeShort(targetValue);
}
origin: apache/asterixdb

  protected void parseString(char[] buffer, int begin, int length, DataOutput out) throws HyracksDataException {
    try {
      out.writeByte(ATypeTag.STRING.serialize());
      untaggedStringSerde.serialize(buffer, begin, length, out);
    } catch (IOException e) {
      throw new ParseException(e);
    }
  }
}
origin: apache/asterixdb

/**
 * Serialize the field with a type tag
 *
 * @param dataOutput
 * @throws IOException
 */
default void serialize(DataOutput dataOutput) throws IOException {
  dataOutput.writeByte(getType().serialize());
  serializeValue(dataOutput);
}
origin: apache/asterixdb

@Override
public void convertType(byte[] data, int start, int length, DataOutput out) throws IOException {
  double targetValue = convertType(data, start);
  out.writeByte(ATypeTag.DOUBLE.serialize());
  DoubleSerializerDeserializer.write(targetValue, out);
}
origin: apache/asterixdb

public void writeItem(int itemIndex, DataOutput dos) throws IOException {
  int itemOffset = getItemOffset(itemIndex);
  int itemLength = getItemLength(itemOffset);
  if (itemsAreSelfDescribing()) {
    ++itemLength;
  } else {
    dos.writeByte(itemType.serialize());
  }
  dos.write(listBytes, itemOffset, itemLength);
}
origin: apache/asterixdb

public static void serializeTag(IAObject instance, DataOutput out) throws HyracksDataException {
  IAType t = instance.getType();
  ATypeTag tag = t.getTypeTag();
  try {
    out.writeByte(tag.serialize());
  } catch (IOException e) {
    throw HyracksDataException.create(e);
  }
}
origin: apache/asterixdb

  public void getItemValue(AbstractCollectionType inputType, int index, DataOutput dOut) throws IOException {
    if (getType() != ATypeTag.ANY.serialize()) {
      dOut.writeByte(getType());
    }
    dOut.write(bytes, getItemOffset(inputType, index), getItemSize(inputType, index));
  }
}
origin: apache/asterixdb

public static long getIntervalEnd(byte[] data, int start) {
  if (getIntervalTimeType(data, start) == ATypeTag.DATETIME.serialize()) {
    return LongPointable.getLong(data, getIntervalEndOffset(data, start));
  } else {
    return IntegerPointable.getInteger(data, getIntervalEndOffset(data, start));
  }
}
origin: apache/asterixdb

public static long getIntervalStart(byte[] data, int start) {
  if (getIntervalTimeType(data, start) == ATypeTag.DATETIME.serialize()) {
    return LongPointable.getLong(data, getIntervalStartOffset(data, start));
  } else {
    return IntegerPointable.getInteger(data, getIntervalStartOffset(data, start));
  }
}
origin: apache/asterixdb

private int compareStringWithArg(ATypeTag typeTag2, IPointable arg1, IPointable arg2) throws HyracksDataException {
  if (typeTag2 == ATypeTag.STRING) {
    return strBinaryComp.compare(arg1.getByteArray(), arg1.getStartOffset(), arg1.getLength() - 1,
        arg2.getByteArray(), arg2.getStartOffset(), arg2.getLength() - 1);
  }
  throw new IncompatibleTypeException(sourceLoc, COMPARISON, ATypeTag.SERIALIZED_STRING_TYPE_TAG,
      typeTag2.serialize());
}
org.apache.asterix.om.typesATypeTagserialize

Popular methods of ATypeTag

  • isDerivedType
  • equals
  • ordinal
  • isListType
  • toString
  • hashCode
  • name
  • values

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JFileChooser (javax.swing)
  • JPanel (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now