Skip to content

pierre/action-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Action core

The Action core exposes HDFS over HTTP. It provides a REST interface as well as a browsing UI. Unlike the browser shipped with the Hadoop namenode, it integrates a de-serialization mechanism to read files content.

More detailed documentation can be found here.

Download

war artifacts can be found at Maven Central.

Build

mvn install

Configuration options

See ActionCoreConfig.java for configuration options.

Run

mvn -Daction.hadoop.namenode.url=hdfs://namenode.company.com:9000 jetty:run

You can now browse HDFS:

http://127.0.0.1:8080/rest/1.0/hdfs?path=/

Query parameters

  • path: path to open in HDFS

  • range: when opening a file, bucket of lines to display (e.g. range=1-50 for the first 51 lines)

  • raw: whether to display the nice, HTML version (raw=true) or plain text (raw=false)

  • recursive: whether to craw a directory recursively. If you want to download all content under /user/pierre:

    curl 'http://127.0.0.1:8080/rest/1.0/hdfs?path=/user/pierre&recursive=true&raw=true'
    

Notes on serialization

You can specify your custom Hadoop serialization classes (which implement org.apache.hadoop.io.serializer.Serialization<T>) on the command line (make sure to escape the comma):

-Daction.hadoop.io.serializations=com.company.HadoopSecretSerialization\,org.apache.hadoop.io.serializer.WritableSerialization

You can also implement custom renderers, see the documentation for more details.

Documenting schemas

When clicking on a row, an exploded content of the row is show as JSON. By default, each column is labeled as “Field_…”. This can be overridden by implementing the Registrar interface.

The Action core supports out of the box Goodwill (see github.com/pierre/goodwill) which is an HTTP based type registrar.

License (see COPYING file for full license)

Copyright 2010-2012 Ning

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.