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 java.io.IOException; | |
| import java.net.URISyntaxException; | |
| import java.nio.file.Files; | |
| import java.nio.file.Paths; | |
| import java.security.KeyFactory; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.PrivateKey; | |
| import java.security.interfaces.RSAPublicKey; | |
| import java.security.spec.InvalidKeySpecException; | |
| import java.security.spec.PKCS8EncodedKeySpec; |
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 java.lang.reflect.Field; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.util.Map; | |
| import java.util.Optional; | |
| import org.apache.commons.beanutils.PropertyUtils; | |
| public class BeanTester { |
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
| CREATE TABLE EMPLOYEE ( | |
| empno INTEGER AUTO_INCREMENT, | |
| name VARCHAR(10), | |
| job VARCHAR(9), | |
| hiredate VARCHAR(12), | |
| salary DECIMAL(7, 2), | |
| comm DECIMAL(7, 2), | |
| deptno INTEGER, | |
| PRIMARY KEY (empno), |
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
| public String URLifyJava8(String str) { | |
| return str.chars() | |
| .mapToObj(c -> (char) c) | |
| .flatMap(c -> Character.isWhitespace(c) | |
| ? "%20".chars().mapToObj(ch -> (char) ch) : Stream.of(c)) | |
| .collect(Collector | |
| .of(StringBuilder::new, StringBuilder::append, | |
| (r1, r2) -> { | |
| r1.append(r2); | |
| return r1; |
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
| source :- http://www.michael-noll.com/blog/2013/03/17/reading-and-writing-avro-files-from-the-command-line/ | |
| download tools jar - http://mirror.catn.com/pub/apache/avro/avro-1.7.5/java/avro-tools-1.7.5.jar | |
| add following to ~/.bashrc | |
| alias avro='java -jar /home/yash/software/avro/avro-tools-1.7.5.jar' | |
| now use just as avro command | |
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
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-surefire-plugin</artifactId> | |
| <version>2.14</version> | |
| <configuration> | |
| <debugForkedProcess>true</debugForkedProcess> | |
| </configuration> | |
| </plugin> |
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
| -- http://www.dbjungle.com/hp-vertica-database-log-files-and-their-locations/ | |
| select /*+label(Source: www.dbjungle.com )*/ node_name, | |
| replace(replace(storage_path,node_name,''),'/_catalog/Catalog','/dbLog') as dbLog_location, | |
| replace(storage_path,'/Catalog','/vertica.log') as vertoca_log_location | |
| from disk_storage where storage_usage = 'CATALOG' | |
| order by node_name; |
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
| -- http://vertica.tips/2013/10/23/disk-space-utilization/ | |
| SELECT node_name, | |
| SUM(used_bytes)/(1024^3) AS disk_space_used_gb, | |
| SUM((used_bytes+free_bytes)-used_bytes)/(1024^3) AS disk_space_free_gb, | |
| SUM(used_bytes+free_bytes)/(1024^3) AS disk_space_total_gb | |
| FROM v_monitor.storage_usage | |
| WHERE filesystem = 'vertica' | |
| GROUP BY node_name | |
| ORDER BY node_name; |
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
| #install docker for mac, url - https://docs.docker.com/docker-for-mac/ | |
| docker pull sequenceiq/spark | |
| #create a mac directory hadoop-spark and map it to /home/hadoop-spark | |
| docker run -it -p 8088:8088 -p 8042:8042 -h sandbox -v /Users/admin/Documents/docker/hadoop-spark:/home/hadoop-spark sequenceiq/spark bash | |
| then run | |
| /etc/bootstrap.sh | |
| #add host name called sandbox to localhost on file /etc/hosts |
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
| @Before | |
| public void setupRequestScope() { | |
| if (applicationContext instanceof GenericApplicationContext) { | |
| GenericApplicationContext context = (GenericApplicationContext) applicationContext; | |
| ConfigurableListableBeanFactory beanFactory = context.getBeanFactory(); | |
| Scope requestScope = new SimpleThreadScope(); | |
| beanFactory.registerScope("request", requestScope); | |
| } | |
| } |
NewerOlder