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.

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)

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-0.1.0.tar.gz (5.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-0.1.0-py2.py3-none-any.whl (12.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for streamsx.hdfs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 79e033da835136a3b4937ff69765225f34b915063af8bece3b0251c630836003
MD5 d9d25f4dbefec7e6aaf990679a7aff31
BLAKE2b-256 b1aa0c8f872ed771ee6d70325847a0541bec7e9e16c74c324a891f6f74995dde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamsx.hdfs-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e8b0197a18807e4bc0165a5bc1a60dd5f7c0b1c8f7cddea47ec313bc207b5344
MD5 eaa3a94b69e1797311b84f0f2109aea2
BLAKE2b-256 79347be3b2af6b58b2dc03b21f6a280aab4fe088bfcc15f7061d173933cd9bd7

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