ITeye博客

2013 年文章归档

共 38 篇文章

【转】 Nobody Needs Reliable Messaging

http://www.infoq.com/articles/no-reliable-messaging Author: Marc A received view in SOA and Web Services is the need for reliable messaging. Reliable messaging is the guarantee that a message sent by a sending application is indeed received at the other end, and received only once. One of the most …

2013-11-13 15:20

Java实现四则混合运算

使用栈来实现,可以处理运算优先级。 使用自然四则运算表达式即可,如:4+(3*(3-1)+2)/2。无需把表达式先转换为逆波兰等形式。 package com.joshua.cal; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Stack; publi…

2013-09-25 13:45 · Java · Java · Stack · 四则运算

WOW! LZ4, 超越Snappy的压缩算法

Wow, LZ4 is fast! I’ve been doing some experiments with LZ4 recently and I must admit that I am truly impressed. For those not familiar with LZ4, it is a compression format from the LZ77 family. Compared to other similar algorithms (such as Google’s Snappy ), LZ4’s file format does not allow for ve…

2013-08-22 16:49 · Compression · 压缩

Stanford University --- Machine Learning

Google Brain之父,斯坦福大学教授Andrew Ng带来的机器学习课程。 另注:Andrew同时也是coursera的创始人。 https://www.coursera.org/course/ml About the Course Machine learning is the science of getting computers to act without being explicitly programmed. In the past decade, machine learning has given us self-driving cars, practical sp…

2013-07-30 09:05 · Machine Learning

使用Policy文件控制Applet权限

本文介绍在Java平台上如何访问受限资源,比如读写一个文件。我们通过配置policy文件来使得一个未签名的applet访问系统的受限资源。本文主要由以下内容组成: 对于Applet的限制 如何配置Policy文件 如何使Policy生效 对于Applet的限制 Java插件使用Security Manager来防止病毒通过applet侵入你的系统。如果未签名的applet想访问某个系统资源,Security Manager会检查对应的权限是否已经授权,未授权的applet无法访问系统资源。授权需要配置policy文件中的entry。 Oracle官方提供了一个applet的例子。 impor…

2013-07-12 09:25 · Java · Security · Java · Security · applet · policy

Presentations

Architecting for High Availability http://www.infoq.com/presentations/architecting-high-availability The Fundamentals of JVM Tuning http://www.infoq.com/presentations/jvm-tuning Large-Scale Continuous Testing in the Cloud http://www.infoq.com/presentations/Continuous-Testing-Build-Cloud

2013-07-10 16:07 · Presentations

Apache Hadoop YARN – ResourceManager (From Hortonworks)

Apache Hadoop YARN – ResourceManager As previously described, ResourceManager (RM) is the master that arbitrates all the available cluster resources and thus helps manage the distributed applications running on the YARN system. It works together with the per-node NodeManagers (NMs) and the per-appl…

2013-07-02 15:43 · Hadoop · Hadoop · ResourceManager

Apache Hadoop YARN – NodeManager (From Hortonworks)

Apache Hadoop YARN – NodeManager The NodeManager (NM) is YARN’s per-node agent, and takes care of the individual compute nodes in a Hadoop cluster. This includes keeping up-to date with the ResourceManager (RM), overseeing containers’ life-cycle management; monitoring resource usage (memory, CPU) o…

2013-07-02 15:42 · Hadoop · Hadoop · nodemanager

常见的 Kerberos 错误消息 (N-Z)

本节按字母顺序 (N-Z) 列出了 Kerberos 命令、Kerberos 守护进程、PAM 框架、GSS 接口、NFS 服务和 Kerberos 库的常见错误消息。 No credentials cache file found 原因: Kerberos 无法找到凭证高速缓存 ( /tmp/krb5cc_uid )。 解决方法: 请确保该凭证文件存在并且可以读取。否则,请再次尝试执行 kinit 。 No credentials were supplied, or the credentials were unavailable or inaccessible No credential…

2013-06-27 16:26 · Security · kerberos

常见的 Kerberos 错误消息 (A-M)

本节按字母顺序 (A-M) 列出了 Kerberos 命令、Kerberos 守护进程、PAM 框架、GSS 接口、NFS 服务和 Kerberos 库的常见错误消息。 All authentication systems disabled; connection refused 原因: 此版本的 rlogind 不支持任何验证机制。 解决方法: 请确保调用的 rlogind 带有 -k 选项。 Another authentication mechanism must be used to access this host 原因: 无法进行验证。 解决方法: 请确保客户机使用 Kerber…

2013-06-27 16:25 · Security · kerberos

TPC-H on Hive

TPC-H 是数据库/数据仓库选型决策用的benchmark。它是世界公认的benchmark,由一套面向业务的数据查询和并发数据更新组成。百度文库里有个 文档 写的还不错。 Jia, Yuntao在 HIVE-600 中提交了TPC-H的hive driver。Driver由shell脚本作为bootstrap,由一系列HQL文件组成,总共22个benchmark。Driver中并不包含原始数据,需要使用TPC-H的DBGEN生成。

2013-06-10 20:37 · Hive · Performance Tunning · benchmark · performance · hive · benchmark

Java Makefile【转】

Java Makefile A simple replacement for Ant Version 4.4, January 2011 Geotechnical Software Services Copyright © 1999 - 2011 This document is available at http://geosoft.no/development/javamake.html Abstract: A cross-platform (MS-Windows, Linux, UNIX) makefile for a wide range of programming languag…

2013-05-31 13:16 · Java · Tools · Java · Makefile · make · compile

Linux,如何看性能

摘自Brendan Gregg(Lead Performance Engineer of joyent)的PPT。joyent公司可能很多人没听说过,但是提到node.js,相信很多人都知道。joyent公司正是node.js的主要开发者

2013-05-22 10:48 · Performance Tunning · performance · Linux · tool · analysis

HDFS v2 HA方案对比

Apache提供了两种HDFS v2 的HA方案。HA的具体实现和使用方式本文就不赘述了,可以参考以下链接: HA with NFS HA with QJM CDH(Cloudera的Hadoop发行版)在早期的版本中只支持HA with NFS方案。自CDH4.1起,增加对HA with QJM的支持。QJM由Cloudera设计,并已经merge到Hadoop的TRUNK(HDFS-3077)。 本文旨在对比两种HA方案,为HA选型提供帮助。我们假定读者已经对HDFSv2有一定的了解,对于HDFSv1 HA了解与否并不会影响对本文的理解,因为v2的HA方案和v1的诸多HA实现有相当的差别…

2013-05-02 11:33 · Java · Hadoop

License 【摘录】

GPL & LGPL GPL 是 GNU General Public License (GNU 通用公共许可证)的缩写形式;LGPL 是 GNU Lesser General Public License (GNU 宽通用公共许可证)的缩写形式,旧称 GNU Library General Public License (GNU 库通用公共许可证);GFDL 是 GNU Free Documentation License (GNU 自由文档许可证)的缩写形式。它们是自由软件(Free Software)的通用版权认证协议,由自由软件基金会(FSF)制定和发布。 基于 GPL 的软件允许商…

2013-04-08 19:54 · Production · license

ParSeq in Action

近年来,rest架构风格火了起来,源于越来越多的人在SOA的实践中厌倦了SOAP之流,于是rest api终于抬头。LinkedIn 也于半年前开源了其rest + json的架构: rest.li ,着实为rest加了把火。 什么是ParSeq rest.li允许资源异步地返回结果。这个机制由LinkedIn的另外一个开源项目ParSeq来支撑。ParSeq是轻量级的Java异步操作框架。 ParSeq能做什么 它的主要提供了如下特性: 并行的异步操作机制 顺序执行非阻塞式的任务 任务组合 简单的异常传播和恢复机制 任务执行追踪和可视化 ParSeq的架构简介 在ParSeq的架构里, T…

2013-03-22 16:38 · Java · Tools · Java · Framework · async

IDE导入rest.li源码

rest.li使用gradle来自动构建其代码。 下载rest.li rest.li的源码维护在GitHub上:https://github.com/linkedin/rest.li。可以直接zip方式下载,也可以通过Github客户端下载。 下载后解压 Eclipse Juno 本博文介绍的是插件的网络安装方式,请确认你的网络环境。如有必要,请为Eclipse设置网络代理: Windows->Preferences->General->Network Connections 1. 安装gradle插件 打开ecilpse, Help->Eclipse Marketplace, 搜索grad…

2013-03-21 13:13 · Java · Eclipse · gradle

Eclipse导入spring-framework-3.2.*源码

下载spring-framework源码 Springsource在github上维护源码。https://github.com/SpringSource/spring-framework *本文使用spring-framework-3.2.*源码。 检查安装环境 检查网络环境,如果使用代理上网,需要配置代理信息: Windows用户打开gradlew.bat。linux用户打开gradlew.sh。 增加代理配置: set JAVA_OPTS=-Dhttp.proxyHost=代理服务器host -Dhttp.proxyPort=代理服务器port *检查JDK,Spring 3.2.*需…

2013-03-15 15:10 · Spring · Spring · Eclipse · Framework

单例模式那些坑

作为GOF黄道23宫的白羊宫,单例模式是所有设计模式初学者首先要跨过的坎。本文不赘述单例模式和它的诸多变种(比如懒加载单例,单例工厂模式等等)的用法,而是想和大家聊聊单例背后的那些坑。 第一坑 并发之坑 这个坑相信大部分童鞋都是知道的,毕竟大部分人闭着眼单手也能蹂单例。懒加载是件好事,但是一不小心就犯错了,比如: public class Foo { private static Foo INSTANCE; private Foo() {} public static Foo getInstance() { if (null == INSTANCE) { INSTANCE = new Foo…

2013-03-07 16:03 · Java · Java · 单例模式 · singleton

【Java小技巧】避免过多的构造器参数

我们假设用户类有数十个属性,比如:姓名,性别,年龄等等。 如果使用单一的构造器,会造成构造器参数过多的问题。过多的构造器参数不但降低了代码的可读性,而且大大增加了程序员出错的几率。 比较普遍的解决方案有两个:重叠构造器和Java Bean。我们将介绍并分析这两种方式的优劣并在最后给出一种更合理的解决方案。 重叠构造器 重叠构造器的构建首先需要分析所有属性。把属性非为必填和可选属性两类。第一类构造器提供所有的必填属性。第二类构造器的参数除了必填属性外增加一个可选属性,第三类增加两个可选属性,以此类推,直到构造器包含所有的属性。 比如说,我们的用户类只有姓名和性别是必填属性,那么我们可以如下构建…

2013-03-07 13:27 · Java · Java · constructor · builder · 构造器