org.apache.ignite.internal.binary

## Class BinarySchema

- java.lang.Object
- - org.apache.ignite.internal.binary.BinarySchema

All Implemented Interfaces:
  Externalizable, Serializable

    public class BinarySchema
    extends Object
    implements Externalizable

Schema describing binary object content. We rely on the following assumptions: - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing for quick comparisons performed within already fetched L1 cache line. - When there are more fields, we store them inside a hash map.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `BinarySchema.Builder` Schema builder.
`static class` `BinarySchema.Confirmation` Order confirmation result.

### Field Summary

Fields
`static int` `ORDER_NOT_FOUND` Order returned if field is not found.

### Constructor Summary

Constructors
Constructor and Description
`BinarySchema()` `Externalizable` support.
`BinarySchema(int schemaId, List<Integer> fieldIds)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clarifyFieldName(int order, String name)` Add field name.
`BinarySchema.Confirmation` `confirmOrder(int expOrder, String expName)` Try speculatively confirming order for the given field name.
`boolean` `equals(Object o)`
`int` `fieldId(int order)` Get field ID by order in footer.
`int[]` `fieldIds()` Gets field ids array.
`int` `hashCode()`
`int` `order(int id)` Get field order in footer by field ID.
`void` `readExternal(ObjectInput in)`
`void` `readFrom(DataInput in)` The object implements the readFrom method to restore its contents by calling the methods of DataInput for primitive types and strings or calling readFrom for other objects.
`int` `schemaId()`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`
`void` `writeTo(DataOutput out)` The object implements the writeTo method to save its contents by calling the methods of DataOutput for its primitive values and strings or calling the writeTo method for other objects.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### ORDER_NOT_FOUND

    public static final int ORDER_NOT_FOUND

Order returned if field is not found.

See Also:
  Constant Field Values

### Constructor Detail

#### BinarySchema

    public BinarySchema()

`Externalizable` support.

#### BinarySchema

    public BinarySchema(int schemaId,
                        List<Integer> fieldIds)

Constructor.

Parameters:
  `schemaId` - Schema ID.
  `fieldIds` - Field IDs.

### Method Detail

#### schemaId

    public int schemaId()

Returns:
  Schema ID.

#### confirmOrder

    public BinarySchema.Confirmation confirmOrder(int expOrder,
                                                  String expName)

Try speculatively confirming order for the given field name.

Parameters:
  `expOrder` - Expected order.
  `expName` - Expected name.
Returns:
  Field ID.

#### clarifyFieldName

    public void clarifyFieldName(int order,
                                 String name)

Add field name.

Parameters:
  `order` - Order.
  `name` - Name.

#### fieldId

    public int fieldId(int order)

Get field ID by order in footer.

Parameters:
  `order` - Order.
Returns:
  Field ID.

#### order

    public int order(int id)

Get field order in footer by field ID.

Parameters:
  `id` - Field ID.
Returns:
  Offset or `0` if there is no such field.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### writeTo

    public void writeTo(DataOutput out)
                 throws IOException

The object implements the writeTo method to save its contents by calling the methods of DataOutput for its primitive values and strings or calling the writeTo method for other objects.

Parameters:
  `out` - the stream to write the object to.
Throws:
  `IOException` - Includes any I/O exceptions that may occur.

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### readFrom

    public void readFrom(DataInput in)
                  throws IOException

The object implements the readFrom method to restore its contents by calling the methods of DataInput for primitive types and strings or calling readFrom for other objects. The readFrom method must read the values in the same sequence and with the same types as were written by writeTo.

Parameters:
  `in` - the stream to read data from in order to restore the object
Throws:
  `IOException` - if I/O errors occur

#### fieldIds

    public int[] fieldIds()

Gets field ids array.

Returns:
  Field ids.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018