Exemplo n.º 1
0
def start_offline_to_online_ingestion(
    client: "Client",
    project: str,
    feature_table: FeatureTable,
    start: datetime,
    end: datetime,
) -> BatchIngestionJob:

    launcher = resolve_launcher(client._config)

    return launcher.offline_to_online_ingestion(
        BatchIngestionJobParameters(
            jar=client._config.get(opt.SPARK_INGESTION_JAR),
            source=_source_to_argument(feature_table.batch_source, client._config),
            feature_table=_feature_table_to_argument(client, project, feature_table),
            start=start,
            end=end,
            redis_host=client._config.get(opt.REDIS_HOST),
            redis_port=client._config.getint(opt.REDIS_PORT),
            redis_ssl=client._config.getboolean(opt.REDIS_SSL),
            statsd_host=(
                client._config.getboolean(opt.STATSD_ENABLED)
                and client._config.get(opt.STATSD_HOST)
            ),
            statsd_port=(
                client._config.getboolean(opt.STATSD_ENABLED)
                and client._config.getint(opt.STATSD_PORT)
            ),
            deadletter_path=client._config.get(opt.DEADLETTER_PATH),
            stencil_url=client._config.get(opt.STENCIL_URL),
        )
    )
Exemplo n.º 2
0
def start_offline_to_online_ingestion(feature_table: FeatureTable,
                                      start: datetime, end: datetime,
                                      client: "Client") -> BatchIngestionJob:

    launcher = resolve_launcher(client._config)
    local_jar_path = _download_jar(
        client._config.get(CONFIG_SPARK_INGESTION_JOB_JAR))

    return launcher.offline_to_online_ingestion(
        BatchIngestionJobParameters(
            jar=local_jar_path,
            source=_source_to_argument(feature_table.batch_source),
            feature_table=_feature_table_to_argument(client, feature_table),
            start=start,
            end=end,
            redis_host=client._config.get(CONFIG_REDIS_HOST),
            redis_port=client._config.getint(CONFIG_REDIS_PORT),
            redis_ssl=client._config.getboolean(CONFIG_REDIS_SSL),
        ))