Giter Site home page Giter Site logo

viking's Introduction

Viking

A familiar jRuby hdfs wrapper.

Build Status

Goal

The goal is to provide ways that are similar to the common ruby file system api's for interacting with hdfs. All hdfs functionallity is powered by the java hdfs classes.

Status

Available

  • File
  • Dir
  • FileUtils

Not available yet but on the todo

  • File#fnmatch
  • File#fnmatch?
  • Dir#glob
  • FileUtils#copy

Example usage

# Set up hdfs config
Viking.configure({
  path: "hdfs://hadoop-production" # if using HA hadoop
})

Viking.configure({
  path: "hdfs://namenode.yourcompany.com:8020" # if using a single namenode
})

# If "/some/data" exists and it is a file then print its content. If it is
# a directory then rename it. If it does not exist then we create it.
path = "/some/data"
if Viking::File.exists? path
  if Viking::File.file? path
    Viking::File.open(path) do |file|
      puts "Reading data from #{f.path}:"
      puts f.read
    end
  else
    Viking::File.rename(path, "/some/dir")
  end
else
  Viking::Dir.mkdir(path)
end

Releasing a new version

  1. Update the version in version.rb
  2. Commit this to master
  3. Tag the commit with git tag <version> from (1) and run git push --tags
  4. Go to Shipit and click deploy on the respective commit

Installation

source 'https://packages.shopify.io/shopify/gems' do
  gem 'hdfs-viking'
end

viking's People

Contributors

airhorns avatar buktoria avatar drdee avatar phoet avatar tyro89 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

qpc-github

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.