This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Copyright 2015 Sho Shimauchi | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import random | |
usage = """\ | |
%(prog)s [options] | |
""" | |
def init_parser(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kafka import KafkaConsumer | |
from kafka.client import KafkaClient | |
import kudu | |
from kudu.client import Partitioning | |
import argparse | |
def init_argumentparser(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--kudu_master_address', default='', type=str, required=True) | |
parser.add_argument('--kudu_master_port', default='7051', type=str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# utility functions | |
# wait_seconds N | |
# sleep N seconds | |
# | |
function wait_seconds() | |
{ | |
func_name="wait_seconds" | |
if ! expr "$1" : '[0-9]*' > /dev/null ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aggregate_min=30 # default value | |
usage() | |
{ | |
echo "hadoop-logaggr-timeline.sh [-h] [-t N] file" >&2 | |
echo " -t N[min]: must be integer (default:30) " >&2 | |
echo " aggregates logs each N minutes." >&2 | |
echo " -h: help (this message)" >&2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
echo "hadoop-logaggr.sh [-h] file" >&2 | |
echo " -h: help (this message)" >&2 | |
exit 0 | |
} | |
TEMP=`getopt h $*` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TMP_DIR=/tmp | |
HADOOP_BIN_DIR=${HADOOP_MAPRED_HOME}/bin | |
HADOOP_COMMAND=${HADOOP_BIN_DIR}/hadoop | |
HADOOP_JAR_COMMAND="${HADOOP_COMMAND} jar" | |
MAPRED_SHARE_HOME=${HADOOP_MAPRED_HOME}/share/hadoop/mapreduce | |
HADOOP_EXAMPLE_JAR=${MAPRED_SHARE_HOME}/hadoop*examples*.jar | |
HADOOP_EXAMPLE_COMMAND="${HADOOP_JAR_COMMAND} ${HADOOP_EXAMPLE_JAR}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
source util.sh | |
TMP_DIR=/tmp | |
HADOOP_BIN_DIR=${HADOOP_HOME}/bin | |
HADOOP_COMMAND=${HADOOP_BIN_DIR}/hadoop | |
HADOOP_START_HDFS_COMMAND=`which start-dfs.sh` | |
HADOOP_STOP_HDFS_COMMAND=`which stop-dfs.sh` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage(){ | |
printf "%s:\n" "usage" 1>&2 | |
printf "%s file \n" `basename $0` 1>&2 | |
printf " %-15s: help (this message)" "-h" >&2 | |
} | |
TEMP=`getopt h $*` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
echo "usage: zip_logs.sh [directory] [-prod]" >&2 | |
exit 0 | |
} | |
TEMP=`getopt :h $*` |