Skip to main content

IBM Streams HDFS integration

Project description

Overview

Provides functions to access files on HDFS. For example, connect to IBM Analytics Engine on IBM Cloud.

This package exposes the com.ibm.streamsx.hdfs toolkit as Python methods for use with Streaming Analytics service on IBM Cloud and IBM Streams including IBM Cloud Pak for Data.

Sample

A simple hello world example of a Streams application writing string messages to a file to HDFS. Scan for created file on HDFS and read the content:

from streamsx.topology.topology import *
from streamsx.topology.schema import CommonSchema, StreamSchema
from streamsx.topology.context import submit
import streamsx.hdfs as hdfs

credentials = json.load(credentials_analytics_engine_service)

topo = Topology('HDFSHelloWorld')

to_hdfs = topo.source(['Hello', 'World!'])
to_hdfs = to_hdfs.as_string()

# Write a stream to HDFS
hdfs.write(to_hdfs, credentials=credentials, file='/sample/hw.txt')

scanned = hdfs.scan(topo, credentials=credentials, directory='/sample', init_delay=10)

# read text file line by line
r = hdfs.read(scanned, credentials=credentials)

# print each line (tuple)
r.print()

submit('STREAMING_ANALYTICS_SERVICE', topo)
# Use for IBM Streams including IBM Cloud Pak for Data
# submit ('DISTRIBUTED', topo)

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamsx.hdfs-1.2.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamsx.hdfs-1.2.0-py2.py3-none-any.whl (14.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file streamsx.hdfs-1.2.0.tar.gz.

File metadata

  • Download URL: streamsx.hdfs-1.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for streamsx.hdfs-1.2.0.tar.gz
Algorithm Hash digest
SHA256 a26654fa5eeaa6703bb3fe1c06515003030f4df4ba1290df6afd735bb5a3d6b4
MD5 3abf717a3b7758d63ff290b743eee545
BLAKE2b-256 1b86f3c6f9991ddd5c6ddb3f52eb2b6e3c81b52608d13839aa357cbc6e85d0c5

See more details on using hashes here.

File details

Details for the file streamsx.hdfs-1.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for streamsx.hdfs-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6f74f33ad1b6a9ca63fde4450350443f964955cc9b4f628e782547d85b7d3606
MD5 aa298a82a4e00f1cf3e96745c65de077
BLAKE2b-256 be4fba7fe54fbb6f8a9f209ef3450af2eac3ec417588550d4204e6b27cb722e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page