Coder Social home page Coder Social logo

kiji-rest's Introduction

KijiREST ${project.version}

KijiREST is a REST interface for interacting with KijiSchema.

For more information about KijiREST, see the KijiREST user guide.

For more information about KijiSchema, see the Kiji project homepage.

Further documentation is available at the Kiji project Documentation Portal

Installing KijiREST (requires root privileges)

  • It's assumed that where KijiREST is unpacked is called $KIJI_REST_HOME By default, this is assumed to be /opt/wibi/kiji-rest. This can be changed by modifying the KIJI_REST_HOME variable in bin/kiji-rest.initd script.
  • Create a non-privileged user called "kiji" which will be used to run the service. This can be changed by modifying the KIJI_REST_USER variable in bin/kiji-rest.initd script.
    • sudo useradd kiji
  • Copy $KIJI_REST_HOME/bin/kiji-rest.initd as /etc/init.d/kiji-rest
    • sudo cp $KIJI_REST_HOME/bin/kiji-rest.initd /etc/init.d/kiji-rest
  • chkconfig --add kiji-rest

Starting a local KijiREST server

Any relevant Avro classes that are necessary for interaction of KijiREST with the underlying Kiji tables must be included on the classpath upon instantiation of the server. This is done by placing the jar containing the necessary Avro classes in the $KIJI_REST_HOME/lib folder.

$ cd $KIJI_REST_HOME

$ ./bin/kiji-rest start

This will launch the service in the background with the pid of the process located in $KIJI_REST_HOME/kiji-rest.pid. The application and request logs can be found under $KIJI_REST_HOME/logs.

Alternatively as root:

$ /sbin/service kiji-rest start

Stopping a local KijiREST server

If run as non-root:

$ cat $KIJI_REST_HOME/kiji-rest.pid | xargs kill

As root:

$ /sbin/service kiji-rest stop

Setting up configuration.yml

The configuration.yml file (located in $KIJI_REST_HOME/conf/configuration.yml) is a YAML file used to configure the KijiREST server. The following key is required:

  • "cluster" is the base cluster's kiji URI.

The following is an example of the contents of a proper configuration.yml file:

"cluster" : "kiji://localhost:2181/" #The base cluster URI

  • "instances" is an array of instances that will be made visible to users of the REST service.

If there is no instance array, or it has nothing in it, all instances will be made available.

There is optional key to turn on global cross-origin resource sharing (CORS).

"cors" : "true" #If not set, defaults to false

"cacheTimeout" sets the timeout in minutes before clearing the cache of instances and tables

"remote-shutdown" #when set to true, the admin task to shutdown the kiji-rest via REST command is enabled

KijiREST is implemented using DropWizard. See Dropwizard's User Manual for additional Dropwizard-specific configuration options such as server settings and logging options (console-logging, log files, and syslog).

Creating a KijiREST Plugin

To create a KijiREST plugin project from the maven archetype, use the following command:

mvn archetype:generate
-DarchetypeCatalog=https://repo.wibidata.com/artifactory/kiji-packages/archetype-catalog.xml

From there you can choose the org.kiji.rest:plugin-archetype (A skeleton KijiREST plugin project.) option.

Disabling the "standard" KijiREST plugin

The standard KijiREST plugin is what includes the "/v1" endpoint. Some users may want to disable this access if KijiREST is accessible to a wider audience. For example, if someone deploys a custom plugin to access a certain sub-section of Kiji tables, then disabling access to the "/v1" endpoint will prevent users from reading data from all other tables/restrict access to KijiREST. This also keeps the deployment of plugins consistent by treating the "standard" plugin as separate rather than built-in to the application.

To disable the "standard" KijiREST plugin, simply remove the standard-plugin-.jar from the lib/ directory of KijiREST and restart!

Issues and mailing lists

Users are encouraged to join the Kiji mailing lists: [email protected] and [email protected] (for developers).

Please report your issues at the KijiREST JIRA project.

kiji-rest's People

Contributors

danburkert avatar daisyzhou avatar ajprax avatar wibiclint avatar robotoer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.