public class MutatorCoordinator extends Object implements Closeable, Flushable
SequenceValidator
and grouping is by the GroupingValidator
. An acid delta file is created for each combination partition, and
bucket id (a single transaction id is implied). Once a delta file has been closed it cannot be reopened. Therefore
care is needed as to group the data correctly otherwise failures will occur if a delta belonging to group has been
previously closed. The MutatorCoordinator
will seamlessly handle transitions between groups, creating and
closing Mutators
as needed to write to the appropriate partition and bucket. New partitions will be
created in the meta store if AcidTable.createPartitions()
is set.
Insert
events must be artificially assigned appropriate bucket ids in the preceding
grouping phase so that they are grouped correctly. Note that any transaction id or row id assigned to the
RecordIdentifier
of such events will be ignored by both the coordinator and the underlying
RecordUpdater
.Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
delete(List<String> partitionValues,
Object record)
We expect records grouped by (partitionValues,bucketId) and ordered by (origTxnId,rowId).
|
void |
flush() |
void |
insert(List<String> partitionValues,
Object record)
We expect records grouped by (partitionValues,bucketId) and ordered by (origTxnId,rowId).
|
void |
update(List<String> partitionValues,
Object record)
We expect records grouped by (partitionValues,bucketId) and ordered by (origTxnId,rowId).
|
public void insert(List<String> partitionValues, Object record) throws WorkerException
BucketIdException
- The bucket ID in the RecordIdentifier
of the record does not match that computed
using the values in the record's bucketed columns.RecordSequenceException
- The record was submitted that was not in the correct ascending (origTxnId, rowId)
sequence.GroupRevisitedException
- If an event was submitted for a (partition, bucketId) combination that has already
been closed.PartitionCreationException
- Could not create a new partition in the meta store.WorkerException
public void update(List<String> partitionValues, Object record) throws WorkerException
BucketIdException
- The bucket ID in the RecordIdentifier
of the record does not match that computed
using the values in the record's bucketed columns.RecordSequenceException
- The record was submitted that was not in the correct ascending (origTxnId, rowId)
sequence.GroupRevisitedException
- If an event was submitted for a (partition, bucketId) combination that has already
been closed.PartitionCreationException
- Could not create a new partition in the meta store.WorkerException
public void delete(List<String> partitionValues, Object record) throws WorkerException
BucketIdException
- The bucket ID in the RecordIdentifier
of the record does not match that computed
using the values in the record's bucketed columns.RecordSequenceException
- The record was submitted that was not in the correct ascending (origTxnId, rowId)
sequence.GroupRevisitedException
- If an event was submitted for a (partition, bucketId) combination that has already
been closed.PartitionCreationException
- Could not create a new partition in the meta store.WorkerException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void flush() throws IOException
flush
in interface Flushable
IOException
Copyright © 2021 The Apache Software Foundation. All rights reserved.