npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

oozie

v0.3.1-beta.6

Published

Javascript interface to Oozie hadoop scheduler.

Downloads

16

Readme

Development status

Still in testing, not ready for production

Usage

  var Oozie = require('./index.js');

  var wfconfig = {
    // name: '${wfName}',
    // startTo: 'terserah-biasanya-ada-node',  // ini node action, bisa dikosongkan.
    endName: 'end',
    killName: 'fail',
    killMessage: 'Workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]',  // pesan error ketika gagal.
    action: {
      // name: 'terserah-biasanya-ada-node',  // action name bisa dikosongkan.
      java: {                             // ini kalau action ini menjalankan aplikasi java, selain java belum
        'job-tracker': '${jobTracker}',   // property yang ada di dalam java harus lengkap, minimal seperti ini.
        'name-node': '${nameNode}',
        configuration: {
          property: [{
            name: 'mapred.job.queue.name',
            value: '${queueName}'
          }]
        },
        'main-class': '${classname}',
        'java-opts': [],
        arg: [
          '/user/apps/asep/testin.txt',
          '/user/apps/asep/output'
        ],
        // file: 'file.jar'  // lokasi jar didefinisikan saat new oozie.
      }
    }
  };

  var config = {
    node: {
      hdfs: {
        protocol: 'http',
        hostname: '192.168.1.225',
        port: 50070,
        user: 'apps',
        overwrite: true
      },
      jobTracker: {
        protocol: 'http',
        hostname: '192.168.1.225',
        port: 8032
      },
      nameNode: {
        hostname: '192.168.1.225',
        port: 8020
      },
      oozie: {
        protocol: 'http',
        hostname: '192.168.1.225',
        port: 11000,
        user: 'apps'
      }
    },
    libpath: '/user/apps/lib/247',
    queueName: 'root.default',
    artefact: {
      jar: '/user/apps/oozie-artefact/jar/',
      workflow: '/user/apps/oozie-artefact/workflow/'
    }
  };

  var oozie = new Oozie(config);

  oozie.on('ready', function () {
    oozie.submit('java', null, 'casetwo.jar', 'dummy.casetwo', [], [{
      name: 'namajar',
      value: 'casetwo.jar'
    }], wfconfig, function () {}, false);

    oozie.on('jobSubmitted', function () {
      console.log(subject01.jobid);
    });
  });

Functions

Oozie(config)

Oozie class constructor

Kind: global function

| Param | Type | Description | | --- | --- | --- | | config | Object | Config object. |

oozie.setName(name)

Set name of running job.

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | name | String | Name of job |

oozie.getName() ⇒ String

get name of job.

Kind: instance method of Oozie
Returns: String - job name

oozie.setProperty(property)

Set private property

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | property | Object | Property to be set. |

oozie.genwf(arg, wfconfig, cb)

Generate oozie workflow-app

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | arg | Array | Job workflow arguments | | wfconfig | Object | Full workflow config | | cb | function | Callback function |

oozie.gencoord(coordconfig, cb)

Generate oozie coordinator-app

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | coordconfig | Object | Full coordinator config | | cb | function | Callback function |

oozie.getDefaultProperty() ⇒ Object

Get default property

Kind: instance method of Oozie
Returns: Object - Default property object.

oozie.getDefaultWorkflow() ⇒ Object

Get default workflow

Kind: instance method of Oozie
Returns: Object - Default workflow object.

oozie.submit(type, name, jobfile, className, arg, prop, wfconfig, start, cb)

submit job to oozie

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | type | String | Type of submitted job | | name | String | Name of job, set to random if null | | jobfile | String | Name of file, only name without path, path have been set on constructor. | | className | String | Class path of job. | | arg | Array | Array of job arguments, set empty array to set no argument. | | prop | Array | Array of object properties, this array will be concatenated to default properties, set empty array if using default properties only. | | wfconfig | Object | Object of custom workflow config | | start | Boolean | Start job immediately after submitted | | cb | function | Callback function. |

oozie.submitcoord(name, prop, coordconfig, cb)

submit coordinator to oozie

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | name | String | Name of job, set to random if null | | prop | Array | Array of object properties, this array will be concatenated to default properties, set empty array if using default properties only. | | coordconfig | Object | Object of custom workflow config | | cb | function | Callback function. |

oozie.start(jobid)

Start Job

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | jobid | String | Job ID to be Start. |

oozie.kill(jobid)

Kill Job

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | jobid | String | Job ID to be Killed. |

oozie.suspend(jobid)

Suspend Job

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | jobid | String | Job ID to be Suspended. |

oozie.resume(jobid)

Resume Job

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | jobid | String | Job ID to be Resumed. |

oozie.rerun(jobid)

Re running job, identified by jobid.

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | jobid | String | Job id that needed to run. |

oozie.get(jobid)

Get job info identified by jobId.

Kind: instance method of Oozie

| Param | Type | Description | | --- | --- | --- | | jobid | String | Job Id that needed to get. |

defaultResponse(e, r, b)

Response default for start, rerun, get.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | e | Object | Error Object from request. | | r | Object | Response Object from request. | | b | Mixed | Response body from request. |