0.0
No commit activity in last 3 years
No release in over 3 years
jruby hdfs wrapper attempting to provide an interface that's similar to the common ruby file system api's.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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({
  host: '127.0.0.1',
  port: 54310
})

# 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