Package org.kiji.schema.layout

Examples of org.kiji.schema.layout.SchemaTableAvroResolver


    if (null == writers) {
      return new Schema.Parser().parse(layout.getCellSchema(column).getValue());
    } else {
      Preconditions.checkState(writers.size() == 1,
          "FINAL columns must have exactly one writer schema, found: " + writers);
      return new SchemaTableAvroResolver(layout.getSchemaTable()).apply(writers.get(0));
    }
  }
View Full Code Here


  private static Schema getReaderSchema(KijiTableLayout layout, BoundColumnReaderSpec spec)
      throws IOException {
    switch (spec.getColumnReaderSpec().getAvroReaderSchemaType()) {
      case DEFAULT: {
        final CellSchema cellSchema = layout.getCellSchema(spec.getColumn());
        final SchemaTableAvroResolver resolver =
            new SchemaTableAvroResolver(layout.getSchemaTable());
        return resolver.apply(cellSchema.getDefaultReader());
      }
      case EXPLICIT: return spec.getColumnReaderSpec().getAvroReaderSchema();
      case WRITER: return null;
      default: throw new InternalKijiError(
          "Unknown AvroReaderSchemaType: " + spec.getColumnReaderSpec().getAvroReaderSchemaType());
View Full Code Here

  private static Set<Schema> getRegisteredWriters(final CellSpec spec) throws IOException {
    final List<AvroSchema> writerSchemas = spec.getCellSchema().getWriters();
    if (writerSchemas == null) {
      return null;
    }
    final AvroSchemaResolver resolver = new SchemaTableAvroResolver(spec.getSchemaTable());
    return Sets.newHashSet(Collections2.transform(writerSchemas, resolver));
  }
View Full Code Here

  public static boolean avroSchemaEquals(
      final KijiSchemaTable schemaTable,
      final AvroSchema first,
      final AvroSchema second
  ) throws IOException {
    final AvroSchemaResolver resolver = new SchemaTableAvroResolver(schemaTable);

    return Objects.equal(resolver.apply(first), resolver.apply(second));
  }
View Full Code Here

          if (refCellSchema.getWritten() != null) {
            writerSchemaIDs.addAll(refCellSchema.getWritten());
          }
        }

        final AvroSchemaResolver resolver = new SchemaTableAvroResolver(mKiji.getSchemaTable());

        // Resolve reader Avro schema descriptors to Schema objects:
        final List<Schema> readerSchemas =
            Lists.newArrayList(Collections2.transform(readerSchemaIDs, resolver));
View Full Code Here

TOP

Related Classes of org.kiji.schema.layout.SchemaTableAvroResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.