Search in sources :

Example 6 with IntersectionRule

use of com.google.cloud.bigtable.admin.v2.models.GCRules.IntersectionRule in project java-bigtable by googleapis.

the class TableAdminExampleTest method testCreateNestedRule.

@Test
public void testCreateNestedRule() {
    // Nested rule
    tableAdmin.addFamilyWithNestedRule();
    VersionRule versionRule = GCRULES.maxVersions(10);
    DurationRule maxAgeRule = GCRULES.maxAge(30, TimeUnit.DAYS);
    VersionRule versionRule2 = GCRULES.maxVersions(2);
    IntersectionRule intersectionRule = GCRULES.intersection().rule(maxAgeRule).rule(versionRule2);
    UnionRule nestedCondition = GCRULES.union().rule(intersectionRule).rule(versionRule);
    boolean nestedRule = ruleCheck(nestedCondition);
    assertTrue(nestedRule);
}
Also used : IntersectionRule(com.google.cloud.bigtable.admin.v2.models.GCRules.IntersectionRule) UnionRule(com.google.cloud.bigtable.admin.v2.models.GCRules.UnionRule) DurationRule(com.google.cloud.bigtable.admin.v2.models.GCRules.DurationRule) VersionRule(com.google.cloud.bigtable.admin.v2.models.GCRules.VersionRule) Test(org.junit.Test)

Aggregations

IntersectionRule (com.google.cloud.bigtable.admin.v2.models.GCRules.IntersectionRule)6 DurationRule (com.google.cloud.bigtable.admin.v2.models.GCRules.DurationRule)5 VersionRule (com.google.cloud.bigtable.admin.v2.models.GCRules.VersionRule)4 Test (org.junit.Test)4 UnionRule (com.google.cloud.bigtable.admin.v2.models.GCRules.UnionRule)3 ModifyColumnFamiliesRequest (com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest)3 AlreadyExistsException (com.google.api.gax.rpc.AlreadyExistsException)2 GcRule (com.google.bigtable.admin.v2.GcRule)1 ColumnFamily (com.google.cloud.bigtable.admin.v2.models.ColumnFamily)1 Table (com.google.cloud.bigtable.admin.v2.models.Table)1 ByteString (com.google.protobuf.ByteString)1