Skip to content

Instantly share code, notes, and snippets.

View tzolov's full-sized avatar

Christian Tzolov tzolov

View GitHub Profile
@tzolov
tzolov / gist:1638197
Created January 19, 2012 05:36
Test Java Snippet
public interface Oauth2ClientOperations {
String SECURITY_FILTER_NAME = "springSecurityFilterChain";
boolean isOAuthClientInstallationPossible();
void installOAuthClient(String authorizationServerUri, String protectedResourceUri);
}
@tzolov
tzolov / ESCrunch.java
Last active December 16, 2015 11:39
Example ElasticSerach Crunch Integration (using ElasticSearch-Hadoop) Application reads a sample 'twitter' index from ES, counts the messages per user and writes the result counts to different ES index. This example uses {@link Map} as a mean to represent the data read-from and written-to ES. Prerequisite: latest Crunch:0.6.0-SNAPSHOT and latest…
/*
* Copyright 2013 the original author or authors.
*
* 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
@tzolov
tzolov / 5_steps_installation.sh
Last active December 21, 2015 07:18
* Vagrantfile for Pivotal HD 1.0.1 CE - Defines the type of VMs required and how to configure and provision those machines * pcc_provision.sh - Provisioning is applied only to the pcc VM. It follows the PHD_10_Guid.pdf instruction to install PCC on the pcc VM and PHD on the phd[1..3] VMs. Annotations in the script can provide additional informat…
#!/bin/bash
# Make sure you have the latest Vagrant and VirtualBox installed.
# 1. Add CentOS-6.2-x86_64 box to your Vagrant configuration.
vagrant box add CentOS-6.2-x86_64 https://s3.amazonaws.com/Vagrant_BaseBoxes/centos-6.2-x86_64-201306301713.box
# 2. Download and uncompress the PHD 1.0.1.
wget "http://bitcast-a.v1.o1.sjc1.bitgravity.com/greenplum/pivotal-sw/phd_1.0.1.0-19_community.tar.gz"
tar -xzf ./phd_1.0.1.0-19_community.tar.gz
@tzolov
tzolov / Vagrantfile
Last active December 22, 2015 04:18
Vagrantfile for Pivotal HD 1.0.1 CE + HAWQ 1.1.0-8 Defines the type of VMs required and how to configure and provision those machines * pcc_provision.sh - Provisioning is applied only to the pcc VM. It follows the PHD_10_Guid.pdf instruction to install PCC on the pcc VM and PHD on the phd[1..3] VMs. Annotations in the script can provide addition…
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# Embedded provisioning script common for all cluster hosts and PCC.
$phd_provision_script = <<SCRIPT
#!/bin/bash
@tzolov
tzolov / Download Pivotal Sample Data .sh
Last active December 22, 2015 05:09
Testing the multi-VMs Pivotal HD cluster
# Within your vagrant project folder:
git clone https://github.com/gopivotal/pivotal-samples.git
mv pivotal-samples/sample-data ./retail_demo
rm -Rf ./pivotal-samples
# login to the PHD master (and client) node. The ssh password: gpadmin
# phd1 = 10.211.55.101
@tzolov
tzolov / Vagrant_PHD1.1.x_Installation
Last active August 29, 2015 13:56
Vagrant Pivotal HD 1.1.x Installation
Copy Vagrant and pcc_provision_phd110.sh in the PHDCE1.1 folder
import com.pivotal.hawq.mapreduce.HAWQInputFormat;
import com.pivotal.tzolov.poc.hif.HAWQInputFormat2;
import com.pivotal.hawq.mapreduce.HAWQRecord;
import org.apache.spark.deploy.{LocalSparkCluster, SparkHadoopUtil};
// Create separate Hadoop configuration instances for each input table
val hadoopConf1 = SparkHadoopUtil.get.newConfiguration();
val hadoopConf2 = SparkHadoopUtil.get.newConfiguration();
// Retrieve the HAWQ tables metadata and store this metadata the dedicated hadoop configuration.
@tzolov
tzolov / designer.html
Created August 14, 2014 10:13
designer
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<polymer-element name="my-element">
@tzolov
tzolov / designer.html
Created August 14, 2014 14:10
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@tzolov
tzolov / designer.html
Created August 14, 2014 18:01
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;