Exemplo n.º 1
0
  /**
   * Initialization to be done after constructor assignments, such as setting of the all-important
   * DDFManager.
   */
  protected void initialize(
      DDFManager manager,
      Object data,
      Class<?>[] typeSpecs,
      String namespace,
      String name,
      Schema schema)
      throws DDFException {
    this.validateSchema(schema);
    this.setManager(manager); // this must be done first in case later stuff needs a manager

    if (typeSpecs != null) {
      this.getRepresentationHandler().set(data, typeSpecs);
    }

    this.getSchemaHandler().setSchema(schema);
    if (schema != null && schema.getTableName() == null) {
      String tableName = this.getSchemaHandler().newTableName();
      schema.setTableName(tableName);
    }

    if (Strings.isNullOrEmpty(namespace)) namespace = this.getManager().getNamespace();
    this.setNamespace(namespace);

    manager.setDDFUUID(this, UUID.randomUUID());

    if (!Strings.isNullOrEmpty(name)) manager.setDDFName(this, name);

    // Facades
    this.ML = new MLFacade(this, this.getMLSupporter());
    this.VIEWS = new ViewsFacade(this, this.getViewHandler());
    this.Transform = new TransformFacade(this, this.getTransformationHandler());
    this.R = new RFacade(this, this.getAggregationHandler());
    this.mCreatedTime = new Date();
  }
Exemplo n.º 2
0
  /**
   * @param manager
   * @param data
   * @param typeSpecs
   * @param namespace
   * @param name
   * @param schema
   * @param tableName: name of the underlying table that representing the DDF
   * @throws DDFException
   */
  protected void initialize(
      DDFManager manager,
      Object data,
      Class<?>[] typeSpecs,
      String namespace,
      String name,
      Schema schema,
      String tableName)
      throws DDFException {

    initialize(manager, data, typeSpecs, namespace, name, schema);

    if (schema != null && tableName != null) {
      schema.setTableName(tableName);
    }
  }