Source:
public void testNestedSecondaryIndexesRepeatedField() throws Exception { CorfuRuntime corfuRuntime = getTestRuntime(); CorfuStoreShim shimStore = new CorfuStoreShim(corfuRuntime); final String someNamespace = "some-namespace"; final String tableName = "ManagedMetadata"; Table<Uuid, ExampleSchemas.ClassRoom, ManagedMetadata> table = shimStore.openTable( someNamespace, tableName, Uuid.class, ExampleSchemas.ClassRoom.class, ManagedMetadata.class, TableOptions.builder().build()); final int totalStudents = 40; final long youngStudent = 15L; final long olderStudent = 25L; ManagedMetadata user = ManagedMetadata.newBuilder().setCreateUser("user_UT").build(); for(int i=0; i<totalStudents; i++) { UUID uuid = UUID.randomUUID(); Uuid key = Uuid.newBuilder() .setMsb(uuid.getMostSignificantBits()).setLsb(uuid.getLeastSignificantBits()) .build(); try (ManagedTxnContext txn = shimStore.txn(someNamespace)) { txn.putRecord(tableName, key, ExampleSchemas.ClassRoom.newBuilder().addStudents(ExampleSchemas.Student.newBuilder() .setName("MaleStudent_" + i) .setAge(i % 2 == 0 ? youngStudent : olderStudent).build()) .addStudents(ExampleSchemas.Student.newBuilder() .setName("FemaleStudent_" + i) .setAge(i % 2 == 0 ? youngStudent : olderStudent).build()) .build(), user); txn.commit(); } } try (ManagedTxnContext readWriteTxn = shimStore.txn(someNamespace)) { List<CorfuStoreEntry<Uuid, ExampleSchemas.ClassRoom, ManagedMetadata>> entries = readWriteTxn .getByIndex(table, "students.age", youngStudent); assertThat(entries.size()).isEqualTo(totalStudents/2); readWriteTxn.commit(); } log.debug(table.getMetrics().toString()); }

Target:
public void testNestedSecondaryIndexesRepeatedField() throws Exception { CorfuRuntime corfuRuntime = getTestRuntime(); CorfuStoreShim shimStore = new CorfuStoreShim(corfuRuntime); final String someNamespace = "some-namespace"; final String tableName = "ManagedMetadata"; Table<Uuid, ExampleSchemas.ClassRoom, ManagedMetadata> table = shimStore.openTable( someNamespace, tableName, Uuid.class, ExampleSchemas.ClassRoom.class, ManagedMetadata.class, TableOptions.builder().build()); final int totalClassRooms = 40; final long youngStudent = 15L; final long olderStudent = 25L; ManagedMetadata user = ManagedMetadata.newBuilder().setCreateUser("user_UT").build(); for (int i = 0; i < totalClassRooms; i++) { UUID uuid = UUID.randomUUID(); Uuid key = Uuid.newBuilder() .setMsb(uuid.getMostSignificantBits()).setLsb(uuid.getLeastSignificantBits()) .build(); try (ManagedTxnContext txn = shimStore.txn(someNamespace)) { txn.putRecord(tableName, key, ExampleSchemas.ClassRoom.newBuilder() .addStudents(ExampleSchemas.Student.newBuilder() .setName("MaleStudent_" + i) .setAge(i % 2 == 0 ? youngStudent : olderStudent).build()) .addStudents(ExampleSchemas.Student.newBuilder() .setName("FemaleStudent_" + i) .setAge(i % 2 == 0 ? youngStudent : olderStudent).build()) .build(), user); txn.commit(); } } try (ManagedTxnContext readWriteTxn = shimStore.txn(someNamespace)) { List<CorfuStoreEntry<Uuid, ExampleSchemas.ClassRoom, ManagedMetadata>> classRooms = readWriteTxn .getByIndex(table, "students.age", youngStudent); assertThat(classRooms.size()).isEqualTo(totalClassRooms/2); readWriteTxn.commit(); } log.debug(table.getMetrics().toString()); }