test를 진행할때마다 잘보면 아래와 같이 뜨는데... 테스트 마다 Session을 생성하는듯 (매우느림)
20/02/28 12:18:33 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
20/02/28 12:18:34 WARN SparkContext: Using an existing SparkContext; some configuration may not take effect.
이때 Spark의 경우 Session을 생성을 해야하기 때문에 sbt tool에 들어가서 test를 하면 매번 Session을 생성해서 불필요한 시간을 사용하게 된다.
spark로 프로젝트할때 python? scala? 고민을 하게되는데, 이때 가장 큰 고민은 scala의 경우에는 build하는 sbt, maven을 사용을 해야하는 점이다. python을 사용하는 사람은 보통 build하는데 익숙하지 않다. 그래서 package의 dependencies를 관리하는게 매우 번거로움 그래서 찾다가보니 proejct를 처음 시작할때 도움을 주는 툴이 있었다.
3. ./gradlew idea * 일단 terminal에서 es repository를 클론해온 elasticsearch 디렉터리로 가서 ./gradlew idea 를 실행 * 이거 해놓고 intellij에서 import해야 자연스럽게 gradle project import가 편해지는 듯.
7. 소스 폴더 distribution>build.gradle에서 xpack.security.enabled'를 false로 바꿔줘야 localhost에서 rest api사용가능함.
8. intellij 터미널에서 ./gradlew run --debug-jvm 실행. * 하다가 뻑나면 ./gradlew clean하고, ./gradlew idea하고 다시 실행.
9. 아래와 같이 run#start가 뜨면 된건데, 이때 intellij>run>attach to process를 누르고 방금 빌드완료한 snapshot넣어주면, 디버깅 준비 완료!! ============-> 98% EXECUTING [33m 6s] > :distribution:run#start
10. 이제 break point 걸어서, localhost:9200/_cluster/settings 등등 api날려보면서 코드 디버깅 할 수 있음.
참고로 gg는 파일 첫번째 줄로 이동, G는 파일 맨끝으로 이동, ==은 indentation 아래는 이명령어의 조합을 사용
파일 전체 들여쓰기
gg=G
To indent the all the lines below the current line
\=G
# To indent the current line
To indent n lines below the current line
n==
For example, to indent 4 lines below the current line
4==
To indent a block of code, go to one of the braces and use command
\=%