@Test public void testIsOriginSchema() { assertTrue(CollapserUtils.isEnvelopeSchema(SampleData.envMetadataRecord11.getSchema())); assertFalse(CollapserUtils.isEnvelopeSchema(SampleData.textRecord.getSchema())); }
public static boolean isEnvelopeSchema(Schema schema) { List<Field> fields = schema.getFields(); if (fields.size() != 2) { return false; } if (schema.getField(FIELD_ORIGIN) == null || schema.getField(FIELD_DATA) == null) { return false; } return true; }
CollapserUtils { public static boolean isEnvelopeSchema(Schema schema) { List<Field> fields = schema.getFields(); if (fields.size() != 2) { return false; } if (schema.getField(FIELD_ORIGIN) == null || schema.getField(FIELD_DATA) == null) { return false; } return true; } }
CollapserUtils { public static boolean isEnvelopeSchema(Schema schema) { List<Field> fields = schema.getFields(); if (fields.size() != 2) { return false; } if (schema.getField(FIELD_ORIGIN) == null || schema.getField(FIELD_DATA) == null) { return false; } return true; } private  CollapserUtils(); }
CollapserUtils { public static boolean isEnvelopeSchema(Schema schema) { List<Field> fields = schema.getFields(); if (fields.size() != 2) { return false; } if (schema.getField(FIELD_ORIGIN) == null || schema.getField(FIELD_DATA) == null) { return false; } return true; } private  CollapserUtils(); static boolean haveEqualSchema(Collection<IndexedRecord> records); static boolean isEnvelopeSchema(Schema schema); static String getOriginValue(IndexedRecord record); static IndexedRecord getDataRecord(IndexedRecord record); @SuppressWarnings("unchecked") static T getNestedFieldValue(IndexedRecord record, String fieldName); static int getNumberOfFilledFields(IndexedRecord record, List<String> fields); static void sortByFilledDataFields(List<T> records, final List<String> fields); static T merge(T base, T update); }
CollapserUtils { public static boolean isEnvelopeSchema(Schema schema) { List<Field> fields = schema.getFields(); if (fields.size() != 2) { return false; } if (schema.getField(FIELD_ORIGIN) == null || schema.getField(FIELD_DATA) == null) { return false; } return true; } private  CollapserUtils(); static boolean haveEqualSchema(Collection<IndexedRecord> records); static boolean isEnvelopeSchema(Schema schema); static String getOriginValue(IndexedRecord record); static IndexedRecord getDataRecord(IndexedRecord record); @SuppressWarnings("unchecked") static T getNestedFieldValue(IndexedRecord record, String fieldName); static int getNumberOfFilledFields(IndexedRecord record, List<String> fields); static void sortByFilledDataFields(List<T> records, final List<String> fields); static T merge(T base, T update);  }