confluence가 동작을 안해서 보니 기존 옵션이 1.8에서는 먹히지 않았다. 

그래서 버전을 1.7로 돌려야 하는데 다음 쉘스크립트를 사용하여 해결했다.


function setjdk() {

  if [ $# -ne 0 ]; then

   removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'

   if [ -n "${JAVA_HOME+x}" ]; then

    removeFromPath $JAVA_HOME

   fi

   export JAVA_HOME=`/usr/libexec/java_home -v $@`

   export PATH=$JAVA_HOME/bin:$PATH

  fi

 }

 function removeFromPath() {

  export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")

 }

setjdk 1.7




참고:

https://www.jayway.com/2014/01/15/how-to-switch-jdk-version-on-mac-os-x-maverick/




모든 메뉴는 핫키로 등록하여 쓸 수 있다.

File Search는 기본적으로 핫키 등록이 안되어 있는데 아래와 같이 구성하여 핫키로 사용하고 있다.





참고

http://stackoverflow.com/questions/91984/how-do-i-hotkey-directly-to-file-search-tab-in-eclipse




log4j 컬러로 출력하기

http://stackoverflow.com/questions/7848325/making-a-log4j-console-appender-use-different-colors-for-different-threads


이클립스 ANSI 콘솔

https://marketplace.eclipse.org/content/ansi-escape-console

def d = java.sql.Date.valueOf( "2010-05-03")
def cal = new GregorianCalendar();
cal.setTime(d)
def dayOfWeek = cal.get(Calendar.DAY_OF_WEEK)

if( dayOfWeek == Calendar.MONDAY)
    println "Monday !"

구글 앱 엔진(Google App Engine) 줄여서 GAE라고들 부른다.
GAE는 파이썬과 자바를 지원한다.
따로 서버 관리가 필요 없기 때문에 개인 개발자는 개발에만 집중하면 되므로 매력적이라고 할 수 있다.

Google App Engine lets you run your web applications on Google's infrastructure.

  • App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow.
  • With App Engine, there are no servers to maintain:
    • You just upload your application, and it's ready to serve your users.

You can serve your app from your own domain name (such as http://www.example.com/) using Google Apps. Or, you can serve your app using a free name on the appspot.com domain. You can share your application with the world, or limit access to members of your organization.

Google App Engine supports apps written in several programming languages.

  • With App Engine's Java runtime environment, you can build your app using standard Java technologies, including the JVM, Java servlets, and the Java programming language—or any other language using a JVM-based interpreter or compiler, such as JavaScript or Ruby.
  • App Engine also features a dedicated Python runtime environment, which includes a fast Python interpreter and the Python standard library.
  • The Java and Python runtime environments are built to ensure that your application runs quickly, securely, and without interference from other apps on the system.

With App Engine, you only pay for what you use.

  • There are no set-up costs and no recurring fees.
  • The resources your application uses, such as storage and bandwidth, are measured by the gigabyte, and billed at competitive rates.
  • You control the maximum amounts of resources your app can consume, so it always stays within your budget.

App Engine costs nothing to get started.

  • All applications can use up to 500 MB of storage and enough CPU and bandwidth to support an efficient app serving around 5 million page views a month, absolutely free.
  • When you enable billing for your application, your free limits are raised, and you only pay for resources you use above the free levels.

출처: 구글 코드 구글 앱 엔진 소개 페이지

Mapper나 Reducer가 퍼센트 변화 없이 가만 있을 때가 있다.
아래 상황을 숙지하고 진행상황을 항상 알 수 있도록 하자.

진행 상황 관련 연산

  • 입력 레코드 읽기 할 때
  • 출력 레코드 쓰기 할 때
  • Reporter 클래스의 setStatus() 메서드로 상태를 설정 할 때
  • Reporter 클래스의 incrCounter() 메서드로 카운터를 증가시킬 때
  • Reporter 클래스 progress() 호출
  • -D 프로퍼티=값
    • 디폴트 값을 무시하고 지정한 프로퍼티 값을 설정함
  • -conf 파일명
    • 설정에 사용할 파일 리스트에 추가
    • 사이트 설정할 때 편리
  • -fs uri
    • 디폴트 파일시스템 설정
    • -D fs.default.name=uri
  • -jt 호스트:포트
    • JobTracker 설정
    • -D mapred.job.tracker=호스트:포트
  • -files 파일1,파일2,…
    • 로컬에 있는 파일을 HDFS에 복사
    • 239페이지 참조
  • -archives 아카이브1,아카이브2,…
    • 지정한 아카이브를 HDFS에 저장
  • -libjars jar1,jar2,…
    • 로컬파일시스템의 jar를 HDFS에 복사
    • 복사 후 MapReduce 태스크의 클래스패스에 추가

The MultipleOutputs class

  • simplifies writting to additional outputs other than the job default output
  • via the OutputCollector passed to the map() and reduce() methods of the Mapper and Reducer implementations.

Each additional output, or named output, may be configured with its own OutputFormat, with its own key class and with its own value class.

A named output can be a single file or a multi file. The later is refered as a multi named output.

A multi named output is an unbound set of files all sharing the same OutputFormat, key class and value class configuration.

When named outputs are used within a Mapper implementation, key/values written to a name output are not part of the reduce phase, only key/values written to the job OutputCollector are part of the reduce phase.

MultipleOutputs supports counters, by default the are disabled.
The counters group is the MultipleOutputs class name.

The names of the counters are the same as the named outputs.
For multi named outputs the name of the counter is the concatenation of the named output, and underscore '_' and the multiname.

Job configuration usage pattern is:

 JobConf conf = new JobConf();

 conf.setInputPath(inDir);
 FileOutputFormat.setOutputPath(conf, outDir);

 conf.setMapperClass(MOMap.class);
 conf.setReducerClass(MOReduce.class);
 ...

 // Defines additional single text based output 'text' for the job
 MultipleOutputs.addNamedOutput(conf, "text", TextOutputFormat.class,
     LongWritable.class, Text.class);

 // Defines additional multi sequencefile based output 'sequence' for the
 // job
 MultipleOutputs.addMultiNamedOutput(conf, "seq",
       SequenceFileOutputFormat.class,
       LongWritable.class, Text.class);
 ...

 JobClient jc = new JobClient();
 RunningJob job = jc.submitJob(conf);

 ...
 

Job configuration usage pattern is:

 public class MOReduce implements Reducer<WritableComparable, Writable> {
     private MultipleOutputs mos;

     public void configure(JobConf conf) {
         ...
         mos = new MultipleOutputs(conf);
     }

     public void reduce(WritableComparable key, Iterator<Writable> values,
         OutputCollector output, Reporter reporter)
         throws IOException {
         ...
         // 단일 출력
         mos.getCollector("text", reporter).collect(key, new Text("Hello"));
         // 다중 출력
         mos.getCollector("seq", "A", reporter).collect(key, new Text("Bye"));
         mos.getCollector("seq", "B", reporter).collect(key, new Text("Chau"));
         ...
     }

     public void close() throws IOException {
         mos.close();
         ...
     }

 }
 

 

참고

+ Recent posts