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/
  • 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('/')

    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.

Files for hdfs-pycompss, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size hdfs-pycompss-0.4.tar.gz (10.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page