Skip to content

Instantly share code, notes, and snippets.

View jayunit100's full-sized avatar
🎯
Focusing

jay vyas jayunit100

🎯
Focusing
View GitHub Profile
@jayunit100
jayunit100 / hive_server_standalone
Last active January 1, 2016 19:09
a quick example of instantiating a hive server for simple tests.
//create a simple server
HiveConf conf = new HiveConf();
HiveServerHandler server = new HiveServerHandler(conf){};
//create a table
String create = "CREATE EXTERNAL TABLE InputData (code STRING, transaction STRING) ROW FORMAT DELIMTED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' STORED AS TEXTFILE LOCATION '/tmp/myinput.txt' ); ";
;
server.execute(create);
//load data into it
text
skipx
install
url --url http://mirror.centos.org/centos/6/os/x86_64/
repo --name=updates --baseurl=http://mirror.centos.org/centos/6/os/x86_64/
lang en_US.UTF-8
keyboard us
rootpw 1234
firewall --disable
authconfig --enableshadow --passalgo=sha512
[root@vagrant bigtop]# ./testcons.sh
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/1
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/2
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/3
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/4
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/5
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/6
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/7
-rw-r--r-- 1 root hadoop 0 Feb 27 01:25 /tmp/hdfs-test/tmp/root/8
-rw-r--r-- 1 root hadoop 132 Feb 27 01:25 /tmp/hdfs-test/tmp/root/9
[root@vagrant bigtop]# umount /tmp/hdfs-test/ ; hadoop-fuse-dfs dfs://vagrant.bigtop1:17020 /tmp/hdfs-test -oentry_timeout=0,attribute_timeout=0 && ./testcons.sh | grep 132 | wc -l
INFO /mnt/jenkins/workspace/Bigtop-0.7.0/label/centos6/build/hadoop/rpm/BUILD/hadoop-2.0.6-alpha-src/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_options.c:164 Adding FUSE arg /tmp/hdfs-test
11
[root@vagrant bigtop]# umount /tmp/hdfs-test/ ; hadoop-fuse-dfs dfs://vagrant.bigtop1:17020 /tmp/hdfs-test && ./testcons.sh | grep 132 | wc -l
INFO /mnt/jenkins/workspace/Bigtop-0.7.0/label/centos6/build/hadoop/rpm/BUILD/hadoop-2.0.6-alpha-src/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_options.c:164 Adding FUSE arg /tmp/hdfs-test
4
[root@vagrant bigtop]# umount /tmp/hdfs-test/ ; hadoop-fuse-dfs dfs://vagrant.bigtop1:17020 /tmp/hdfs-test -oentry_timeout=0,attribute_timeout=0 && ./testcons.sh | grep 132 | wc -l
INFO /mnt/jenkins/workspace/Bigtop-0.7.0/label/centos6/build/hadoop/rpm/BUILD/hadoop-2.0.6-alph
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
@jayunit100
jayunit100 / provision.groovy
Last active August 29, 2015 13:57
provisioner, WIP
#!/usr/bin/env groovy
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
* <p/>
import groovy.json.JsonSlurper;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.List;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import java.io.BufferedReader;
<?xml version="1.0" encoding="UTF-8"?>
<!--
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,
@jayunit100
jayunit100 / gist:9777603
Created March 26, 2014 06:03
ApacheCon Meetup Schedule
ApacheCon Denver BigTop Meetup schedule:
Monday, April 7, 2014
6:00 - 8:00pm
Teller Room, Mezzanine Level (3rd Floor) - The Westin
Tuesday, April 8, 2014
6:00 - 8:00pm
Teller Room, Mezzanine Level (3rd Floor) - The Westin
@jayunit100
jayunit100 / gist:10014317
Created April 7, 2014 03:12
enclosed HCFS Test
package org.apache.hadoop.fs.rawlocal;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;