@Test public void testObtainSchema_OnRead_WhenUserProvidedSchema_Binary_NotFound_Spaces() { expectedException.expect(RuntimeException.class); expectedException.expectMessage("Failed to obtain Avro schema from 'user provided.avro'"); context.setRequestType(RequestContext.RequestType.READ_BRIDGE); context.addOption("SCHEMA", "user provided.avro"); schema = avroUtilities.obtainSchema(context, configuration, hcfsType); }
public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) { Schema schema = (Schema) context.getMetadata(); if (schema != null) { return schema; } try { schemaPath = context.getDataSource(); schema = readOrGenerateAvroSchema(context, configuration, hcfsType); } catch (Exception e) { throw new RuntimeException(String.format("Failed to obtain Avro schema from '%s'", schemaPath), e); } context.setMetadata(schema); return schema; }
AvroUtilities { public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) { Schema schema = (Schema) context.getMetadata(); if (schema != null) { return schema; } try { schemaPath = context.getDataSource(); schema = readOrGenerateAvroSchema(context, configuration, hcfsType); } catch (Exception e) { throw new RuntimeException(String.format("Failed to obtain Avro schema from '%s'", schemaPath), e); } context.setMetadata(schema); return schema; } }
AvroUtilities { public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) { Schema schema = (Schema) context.getMetadata(); if (schema != null) { return schema; } try { schemaPath = context.getDataSource(); schema = readOrGenerateAvroSchema(context, configuration, hcfsType); } catch (Exception e) { throw new RuntimeException(String.format("Failed to obtain Avro schema from '%s'", schemaPath), e); } context.setMetadata(schema); return schema; } private  AvroUtilities();   AvroUtilities(FileSearcher fileSearcher); }
AvroUtilities { public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) { Schema schema = (Schema) context.getMetadata(); if (schema != null) { return schema; } try { schemaPath = context.getDataSource(); schema = readOrGenerateAvroSchema(context, configuration, hcfsType); } catch (Exception e) { throw new RuntimeException(String.format("Failed to obtain Avro schema from '%s'", schemaPath), e); } context.setMetadata(schema); return schema; } private  AvroUtilities();   AvroUtilities(FileSearcher fileSearcher); static AvroUtilities getInstance(); Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType); }
AvroUtilities { public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) { Schema schema = (Schema) context.getMetadata(); if (schema != null) { return schema; } try { schemaPath = context.getDataSource(); schema = readOrGenerateAvroSchema(context, configuration, hcfsType); } catch (Exception e) { throw new RuntimeException(String.format("Failed to obtain Avro schema from '%s'", schemaPath), e); } context.setMetadata(schema); return schema; } private  AvroUtilities();   AvroUtilities(FileSearcher fileSearcher); static AvroUtilities getInstance(); Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType);  }