public class TableBatchOperation extends ArrayList<TableOperation>
A batch operation may contain up to 100 individual table operations, with the requirement that each operation entity must have same partition key. A batch with a retrieve operation cannot contain any other operations. Note that the total payload of a batch operation is limited to 4MB.
Constructor and Description |
---|
TableBatchOperation() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
TableOperation element)
Adds the table operation at the specified index in the batch operation
ArrayList . |
boolean |
add(TableOperation element)
Adds the table operation to the batch operation
ArrayList . |
boolean |
addAll(Collection<? extends TableOperation> c)
Adds the collection of table operations to the batch operation
ArrayList . |
boolean |
addAll(int index,
Collection<? extends TableOperation> c)
Adds the collection of table operations to the batch operation
ArrayList starting at the specified
index. |
void |
clear()
Clears all table operations from the batch operation.
|
void |
delete(TableEntity entity)
Adds a table operation to delete the specified entity to the batch operation.
|
void |
insert(TableEntity entity)
Adds a table operation to insert the specified entity to the batch operation.
|
void |
insert(TableEntity entity,
boolean echoContent)
Adds a table operation to insert the specified entity to the batch operation.
|
void |
insertOrMerge(TableEntity entity)
Adds a table operation to insert or merge the specified entity to the batch operation.
|
void |
insertOrReplace(TableEntity entity)
Adds a table operation to insert or replace the specified entity to the batch operation.
|
void |
merge(TableEntity entity)
Adds a table operation to merge the specified entity to the batch operation.
|
TableOperation |
remove(int index)
Removes the table operation at the specified index from the batch operation.
|
boolean |
remove(Object o)
Removes the specified
Object from the batch operation. |
boolean |
removeAll(Collection<?> c)
Removes all elements of the specified collection from the batch operation.
|
void |
replace(TableEntity entity)
Adds a table operation to replace the specified entity to the batch operation.
|
void |
retrieve(String partitionKey,
String rowKey,
Class<? extends TableEntity> clazzType)
Adds a table operation to retrieve an entity of the specified class type with the specified PartitionKey and
RowKey to the batch operation.
|
void |
retrieve(String partitionKey,
String rowKey,
EntityResolver<?> resolver)
Adds a table operation to retrieve an entity of the specified class type with the specified PartitionKey and
RowKey to the batch operation.
|
clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, retainAll, set, size, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
containsAll, equals, hashCode
public void add(int index, TableOperation element)
ArrayList
.add
in interface List<TableOperation>
add
in class ArrayList<TableOperation>
index
- An int
which represents the index in the batch operation ArrayList
to add
the table operation at.element
- The TableOperation
to add to the batch operation.public boolean add(TableOperation element)
ArrayList
.add
in interface Collection<TableOperation>
add
in interface List<TableOperation>
add
in class ArrayList<TableOperation>
element
- The TableOperation
to add to the batch operation.true
if the operation was added successfully.public boolean addAll(int index, Collection<? extends TableOperation> c)
ArrayList
starting at the specified
index.addAll
in interface List<TableOperation>
addAll
in class ArrayList<TableOperation>
index
- An int
which represents the index in the batch operation ArrayList
to add
the table operation at.c
- A java.util.Collection
of TableOperation
objects to add to the batch operation.true
if the operations were added successfully.public boolean addAll(Collection<? extends TableOperation> c)
ArrayList
.addAll
in interface Collection<TableOperation>
addAll
in interface List<TableOperation>
addAll
in class ArrayList<TableOperation>
c
- A java.util.Collection
of TableOperation
objects to add to the batch operation.true
if the operations were added successfully.public void clear()
clear
in interface Collection<TableOperation>
clear
in interface List<TableOperation>
clear
in class ArrayList<TableOperation>
public void delete(TableEntity entity)
entity
- The TableEntity
to delete.public void insert(TableEntity entity)
entity
- The TableEntity
to insert.public void insert(TableEntity entity, boolean echoContent)
entity
- The TableEntity
to insert.echoContent
- The boolean representing whether the message payload should be returned in the response.public void insertOrMerge(TableEntity entity)
entity
- The TableEntity
to insert if not found or to merge if it exists.public void insertOrReplace(TableEntity entity)
entity
- The TableEntity
to insert if not found or to replace if it exists.public void merge(TableEntity entity)
entity
- The TableEntity
to merge.public void retrieve(String partitionKey, String rowKey, Class<? extends TableEntity> clazzType)
partitionKey
- A String
containing the PartitionKey of the entity to retrieve.rowKey
- A String
containing the RowKey of the entity to retrieve.clazzType
- The class of the TableEntity
type for the entity to retrieve.public void retrieve(String partitionKey, String rowKey, EntityResolver<?> resolver)
partitionKey
- A String
containing the PartitionKey of the entity to retrieve.rowKey
- A String
containing the RowKey of the entity to retrieve.resolver
- The EntityResolver
implementation to project the entity to retrieve as a particular type in
the result.public TableOperation remove(int index)
remove
in interface List<TableOperation>
remove
in class ArrayList<TableOperation>
index
- An int
which represents the index in the ArrayList
of the table operation to
remove from the batch operation.public boolean remove(Object o)
Object
from the batch operation.remove
in interface Collection<TableOperation>
remove
in interface List<TableOperation>
remove
in class ArrayList<TableOperation>
o
- The Object
to remove from the batch operation.true
if the object was removed successfully.public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<TableOperation>
removeAll
in interface List<TableOperation>
removeAll
in class ArrayList<TableOperation>
c
- The collection of elements to remove from the batch operation.true
if the objects in the collection were removed successfully.public void replace(TableEntity entity)
entity
- The TableEntity
to replace.Copyright © 2018. All Rights Reserved.