This file contains 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
cd /home/training | |
mkdir ~/.git | |
git config --global gil.fernandes mymail@mail.com | |
git clone git://github.com/SpringSource/spring-hadoop-samples.git |
This file contains 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>spring-hadoop-samples-mapreduce</artifactId> | |
<name>Spring Hadoop Samples - MapReduce and HDFS</name> | |
<parent> | |
<groupId>org.springframework.samples</groupId> |
This file contains 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.osscube</groupId> | |
<artifactId>spring-hadoop-archetype</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
</project> |
This file contains 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
/* | |
* Copyright 2011-2012 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 |
This file contains 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<name>Spring Hadoop Project</name> | |
<groupId>${groupId}</groupId> | |
<artifactId>${artifactId}</artifactId> | |
<version>${version}</version> | |
<packaging>jar</packaging> |
This file contains 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 java.sql.Connection; | |
import java.sql.ResultSet; | |
import java.sql.Statement; | |
import java.util.logging.Logger; | |
import javax.naming.Context; | |
import javax.naming.InitialContext; | |
import javax.sql.DataSource; | |
Logger log = Logger.getLogger("DisplayTest1") |
This file contains 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
public static ResultSet executeSingleQuery(String query) throws ConnectorException { | |
Connection conn = null; | |
ResultSet data = null; | |
PreparedStatement stmt = null; | |
try { | |
conn = ConnectionFactory.LARGE.getConnection(dbDriver, dbUrl, dbUserName, dbPassword); | |
log.log(Level.INFO, "Query: {0}", query); | |
data = conn.prepareStatement(query).executeQuery(); | |
} catch (final SQLException sqle) { | |
log.log(Level.INFO, "Error SQLException: {0}", sqle.getMessage()); |
This file contains 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
/* | |
OSSCUBE 2014 | |
*/ | |
package com.onepointltd.file.operations; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.PrintWriter; |
This file contains 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
public class ConversionUtils { | |
/** | |
* What happens if number is really null? | |
*/ | |
public static double toDouble(Number number) { | |
return number != null ? number.doubleValue() : null; | |
} | |
This file contains 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
# All the files from which the text is to be extracted | |
allFiles = ["MTMImportAll.txt", "ExportAll.txt"] | |
# Start looping | |
for fName in allFiles | |
# Open the file and read everything | |
f = open("src/test/resources/$fName") | |
println("******* Processing $f ****************") | |
array = readlines(f) | |
close(f) | |
# End reading file |
OlderNewer