Skip to main content

HDFSPyCOMPSs is an API that enables PyCOMPSs to read HDFS files in parallel.

Project description

Integration: PyCOMPSs and HDFS

The abstraction that is provided by this version is exactly the same as that provided by the version in java. Please read the Java version before continuing.

How to install the HDFSPyCOMPSs module

This module is available at PyPi,

    $ pip3 install hdfs-pycompss

After install it, you need set up some environment variables:

  • HADOOP_HOME: the root of your installed Hadoop distribution. Often has lib/native/libhdfs.so.
  • JAVA_HOME: the location of your Java SDK installation.
  • CLASSPATH: must contain the Hadoop jars
export CLASSPATH=$CLASSPATH:`$HADOOP_HOME/bin/hdfs classpath --glob`

Because COMPSs don't copy all environment variables to all workers, it's important to set these variables at /etc/environment.

Example of how to use the API (without StorageAPI)

def wordcount(blk, word):
    from hdfspycompss.block import Block
    data = Block(blk).read_block()
    ...
    return result

def main():
    import hdfspycompss.hdfs import HDFS
    dfs = HDFS(host='localhost', port=9000)
    HDFS_BLOCKS = dfs.find_blocks('/input.data')

    nFrag = len(HDFS_BLOCKS)
    result = [{} for f in range(nFrag)]
    for f, blk in enumerate(HDFS_BLOCKS):
        result[f] = wordcount(blk, 'word')
    ...

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

hdfs-pycompss-0.4.tar.gz (10.4 kB view hashes)

Uploaded Source

Supported by

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