Search in sources :

Example 1 with HoodieArchivedMetaEntry

use of org.apache.hudi.avro.model.HoodieArchivedMetaEntry in project hudi by apache.

the class TestMetadataConversionUtils method testCompletedReplace.

@Test
public void testCompletedReplace() throws Exception {
    String newCommitTime = HoodieTestTable.makeNewCommitTime();
    createReplace(newCommitTime, WriteOperationType.INSERT_OVERWRITE, true);
    HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(new HoodieInstant(State.COMPLETED, HoodieTimeline.REPLACE_COMMIT_ACTION, newCommitTime), metaClient);
    assertEquals(metaEntry.getActionState(), State.COMPLETED.toString());
    assertEquals(metaEntry.getHoodieReplaceCommitMetadata().getOperationType(), WriteOperationType.INSERT_OVERWRITE.toString());
}
Also used : HoodieArchivedMetaEntry(org.apache.hudi.avro.model.HoodieArchivedMetaEntry) HoodieInstant(org.apache.hudi.common.table.timeline.HoodieInstant) Test(org.junit.jupiter.api.Test)

Example 2 with HoodieArchivedMetaEntry

use of org.apache.hudi.avro.model.HoodieArchivedMetaEntry in project hudi by apache.

the class TestMetadataConversionUtils method testCompletedDeltaCommit.

@Test
public void testCompletedDeltaCommit() throws Exception {
    String newCommitTime = HoodieTestTable.makeNewCommitTime();
    createDeltaCommitMetadata(newCommitTime);
    HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(new HoodieInstant(State.COMPLETED, HoodieTimeline.DELTA_COMMIT_ACTION, newCommitTime), metaClient);
    assertEquals(metaEntry.getActionState(), State.COMPLETED.toString());
    assertEquals(metaEntry.getActionType(), HoodieTimeline.DELTA_COMMIT_ACTION);
}
Also used : HoodieArchivedMetaEntry(org.apache.hudi.avro.model.HoodieArchivedMetaEntry) HoodieInstant(org.apache.hudi.common.table.timeline.HoodieInstant) Test(org.junit.jupiter.api.Test)

Example 3 with HoodieArchivedMetaEntry

use of org.apache.hudi.avro.model.HoodieArchivedMetaEntry in project hudi by apache.

the class TestMetadataConversionUtils method testCompletedCompaction.

@Test
public void testCompletedCompaction() throws Exception {
    String newCommitTime = HoodieTestTable.makeNewCommitTime();
    createCompactionMetadata(newCommitTime);
    HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(new HoodieInstant(State.COMPLETED, HoodieTimeline.COMMIT_ACTION, newCommitTime), metaClient);
    assertEquals(metaEntry.getActionState(), State.COMPLETED.toString());
    assertEquals(metaEntry.getHoodieCommitMetadata().getOperationType(), WriteOperationType.COMPACT.toString());
}
Also used : HoodieArchivedMetaEntry(org.apache.hudi.avro.model.HoodieArchivedMetaEntry) HoodieInstant(org.apache.hudi.common.table.timeline.HoodieInstant) Test(org.junit.jupiter.api.Test)

Example 4 with HoodieArchivedMetaEntry

use of org.apache.hudi.avro.model.HoodieArchivedMetaEntry in project hudi by apache.

the class TestMetadataConversionUtils method testCompletedCommit.

@Test
public void testCompletedCommit() throws Exception {
    String newCommitTime = HoodieTestTable.makeNewCommitTime();
    createCommitMetadata(newCommitTime);
    HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(new HoodieInstant(State.COMPLETED, HoodieTimeline.COMMIT_ACTION, newCommitTime), metaClient);
    assertEquals(metaEntry.getActionState(), State.COMPLETED.toString());
    assertEquals(metaEntry.getHoodieCommitMetadata().getOperationType(), WriteOperationType.INSERT.toString());
}
Also used : HoodieArchivedMetaEntry(org.apache.hudi.avro.model.HoodieArchivedMetaEntry) HoodieInstant(org.apache.hudi.common.table.timeline.HoodieInstant) Test(org.junit.jupiter.api.Test)

Example 5 with HoodieArchivedMetaEntry

use of org.apache.hudi.avro.model.HoodieArchivedMetaEntry in project hudi by apache.

the class TestMetadataConversionUtils method testCompletedRollback.

@Test
public void testCompletedRollback() throws Exception {
    String newCommitTime = HoodieTestTable.makeNewCommitTime();
    createRollbackMetadata(newCommitTime);
    HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(new HoodieInstant(State.COMPLETED, HoodieTimeline.ROLLBACK_ACTION, newCommitTime), metaClient);
    assertEquals(metaEntry.getActionState(), State.COMPLETED.toString());
    assertEquals(metaEntry.getHoodieRollbackMetadata().getStartRollbackTime(), newCommitTime);
}
Also used : HoodieArchivedMetaEntry(org.apache.hudi.avro.model.HoodieArchivedMetaEntry) HoodieInstant(org.apache.hudi.common.table.timeline.HoodieInstant) Test(org.junit.jupiter.api.Test)

Aggregations

HoodieArchivedMetaEntry (org.apache.hudi.avro.model.HoodieArchivedMetaEntry)11 HoodieInstant (org.apache.hudi.common.table.timeline.HoodieInstant)9 Test (org.junit.jupiter.api.Test)9 GenericRecord (org.apache.avro.generic.GenericRecord)1 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 FileStatus (org.apache.hadoop.fs.FileStatus)1 HoodieCompactionPlan (org.apache.hudi.avro.model.HoodieCompactionPlan)1 HoodieRequestedReplaceMetadata (org.apache.hudi.avro.model.HoodieRequestedReplaceMetadata)1 HoodieCommitMetadata (org.apache.hudi.common.model.HoodieCommitMetadata)1 HoodieLogFile (org.apache.hudi.common.model.HoodieLogFile)1 HoodieReplaceCommitMetadata (org.apache.hudi.common.model.HoodieReplaceCommitMetadata)1 Reader (org.apache.hudi.common.table.log.HoodieLogFormat.Reader)1 HoodieAvroDataBlock (org.apache.hudi.common.table.log.block.HoodieAvroDataBlock)1 HoodieException (org.apache.hudi.exception.HoodieException)1