RDD - Resilient Distributed Datasets 분산 이뮤터블 자바 객체


http://12bme.tistory.com/306

'몰라그거무서운거 > scala or spark' 카테고리의 다른 글

scala memo  (0) 2018.07.10
  • 값에 타입 선언 이후 변경불가.
  • 문자열보간모드 println(s"문자 $변수출력시앞에 s") / printf 도 있ㅇ넹.
  • && || 비교는 lazy비교... js와 다름... 주의.
  • ? : 일단 삼함 안보임. if (조건) 결과A else 결과B 로 대체가능.
  • 셀렉트 케이스 같은 스위치 케이스 없음. 매치표현식으로.
  • _ 와일드카드 ... 이거뭐야... match case 이외의 케이스를 표현.
  • 숫자 .abs, .min, .max
  • 문자 .reverse .captialize, .toInt
  • def Fu() { } 속에 return 안적어도 마지막ㅇㅣ 리ㄴㅌ됨ㅓ
  • ++나 --는 제공하지 않으므로 += 1을 사용해야 합니다 //////.......... -_-

  • 중첩 for 대신, 조건식 중첩으로 가능.
  • 아래는 메모.
  • scala> b

    res5: List[Any] = List(a, 1, true)


    scala> a

    res6: (String, Int) = (솔라,112123)

  • 테스트
  • 접근 (0) ._1
  • 리턴없는 프로시저


'몰라그거무서운거 > scala or spark' 카테고리의 다른 글

spark  (0) 2018.07.17
javascript, es6, vue, elasticsearch(+LK) ,scala, spark, python, linux, macos, testing tool, react native, hadoop cluster, etl, webpack, ansible, react, airflow, zeppelin, kafka, golang, shell script, restful, YARN, MapReduce, Zookeeper

'잡담' 카테고리의 다른 글

記録 2021.01.11.  (0) 2021.01.12
메모  (0) 2020.11.26
티스토리 방치상태네...  (0) 2020.09.01
NewSQL memo  (0) 2018.07.27
mac에 brew 로 설치한 nginx 메모  (0) 2018.07.04

방금 맥북에 설치한 정보 메모..


==> Installing nginx

==> Downloading https://homebrew.bintray.com/bottles/nginx-1.15.0.high_sierra.bottle.tar.gz

######################################################################## 100.0%

==> Pouring nginx-1.15.0.high_sierra.bottle.tar.gz

==> Caveats

Docroot is: /usr/local/var/www


The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that

nginx can run without sudo.


nginx will load all files in /usr/local/etc/nginx/servers/.


To have launchd start nginx now and restart at login:

  brew services start nginx

Or, if you don't want/need a background service you can just run:

  nginx

==> Summary

🍺  /usr/local/Cellar/nginx/1.15.0: 23 files, 1.4MB



내 서버에는 왜 /etc/nginx

..  암튼 맥북


시작 : $ nginx

종료 : $ nginx -s stop

재시작 : $ nginx -s reload


listen       80 으로 바꾸면 sudo

'잡담' 카테고리의 다른 글

記録 2021.01.11.  (0) 2021.01.12
메모  (0) 2020.11.26
티스토리 방치상태네...  (0) 2020.09.01
NewSQL memo  (0) 2018.07.27
memo  (0) 2018.07.05

빨리 진도 빼야하는데... -_-;


아무튼 배치처리 ...


살펴보니 용도는 대충 배치(일괄) 처리 이후, 그 결과 데이터를 벌크로 올리는 것 같고, 수정이나 삭제도 할 수 있나보다.


  1. 앞에서 다 삭제했지만, 벌크를 써서 만들어 넣어보자.

    ~]$ curl -X POST "localhost:9200/customer/_doc/_bulk?pretty" -H 'Content-Type: application/json' -d'

    > {"index":{"_id":"1"}}

    > {"name": "John Doe1111" }

    > {"index":{"_id":"2"}}

    > {"name": "Jane Doe2222" }

    > '

    {

      "took" : 11,

      "errors" : false,

      "items" : [

        {

          "index" : {

            "_index" : "customer",

            "_type" : "_doc",

            "_id" : "1",

            "_version" : 2,

            "result" : "updated",

            "_shards" : {

              "total" : 2,

              "successful" : 1,

              "failed" : 0

            },

            "_seq_no" : 18,

            "_primary_term" : 2,

            "status" : 200

          }

        },

        {

          "index" : {

            "_index" : "customer",

            "_type" : "_doc",

            "_id" : "2",

            "_version" : 2,

            "result" : "updated",

            "_shards" : {

              "total" : 2,

              "successful" : 1,

              "failed" : 0

            },

            "_seq_no" : 4,

            "_primary_term" : 2,

            "status" : 200

          }

        }

      ]

    }


    똑같은 패턴이다.
    잘 들어갔는지 보려면 조회.

    ~]$ curl -X GET "localhost:9200/customer/_doc/1?pretty"

    {

      "_index" : "customer",

      "_type" : "_doc",

      "_id" : "1",

      "_version" : 2,

      "found" : true,

      "_source" : {

        "name" : "John Doe1111"

      }

    }


    1번

    ~]$ curl -X GET "localhost:9200/customer/_doc/2?pretty"

    {

      "_index" : "customer",

      "_type" : "_doc",

      "_id" : "2",

      "_version" : 2,

      "found" : true,

      "_source" : {

        "name" : "Jane Doe2222"

      }

    }


    얜 2번.

    잘 들어간듯. 


  2. 대량 수정 삭제.

    ~]$ curl -X POST "localhost:9200/customer/_doc/_bulk?pretty" -H 'Content-Type: application/json' -d'

    > {"update":{"_id":"1"}}

    > {"doc": { "name": "John Doe becomes Jane Doe" } }

    > {"delete":{"_id":"2"}}

    > '

    {

      "took" : 23,

      "errors" : false,

      "items" : [

        {

          "update" : {

            "_index" : "customer",

            "_type" : "_doc",

            "_id" : "1",

            "_version" : 3,

            "result" : "updated",

            "_shards" : {

              "total" : 2,

              "successful" : 1,

              "failed" : 0

            },

            "_seq_no" : 19,

            "_primary_term" : 2,

            "status" : 200

          }

        },

        {

          "delete" : {

            "_index" : "customer",

            "_type" : "_doc",

            "_id" : "2",

            "_version" : 3,

            "result" : "deleted",

            "_shards" : {

              "total" : 2,

              "successful" : 1,

              "failed" : 0

            },

            "_seq_no" : 5,

            "_primary_term" : 2,

            "status" : 200

          }

        }

      ]

    }


    한번에 1은 수정 2는 삭제.

    후, 200이 떨어졌으니..... 

    조회.

    ~]$ curl -X GET "localhost:9200/customer/_doc/1?pretty"

    {

      "_index" : "customer",

      "_type" : "_doc",

      "_id" : "1",

      "_version" : 3,

      "found" : true,

      "_source" : {

        "name" : "John Doe becomes Jane Doe"

      }

    }

    [ㅇㅣ름이름@서버서버명 ~]$ curl -X GET "localhost:9200/customer/_doc/2?pretty"

    {

      "_index" : "customer",

      "_type" : "_doc",

      "_id" : "2",

      "found" : false

    }


    오케이 확인 끝.
    꼴랑 id 만으로 삭제함.


  3. 벌크는 중간 처리 내용이 실패한다고 하더라도... 중단하지 않는다. 라고해서 해봄.

    ~]$ curl -X POST "localhost:9200/customer/_doc/_bulk?pretty" -H 'Content-Type: application/json' -d'

    > {"update":{"_id":"2"}}

    > {"doc": { "name": "John Doe becomes Jane Doe" } }

    > {"update":{"_id":"1"}}

    > {"doc": { "name": "John Doe becomes Jane Doe122434" } }

    > 

    > '

    {

      "took" : 75,

      "errors" : true,

      "items" : [

        {

          "update" : {

            "_index" : "customer",

            "_type" : "_doc",

            "_id" : "2",

            "status" : 404,

            "error" : {

              "type" : "document_missing_exception",

              "reason" : "[_doc][2]: document missing",

              "index_uuid" : "4clf5AwmTQ-hruQl7EGJSg",

              "shard" : "2",

              "index" : "customer"

            }

          }

        },

        {

          "update" : {

            "_index" : "customer",

            "_type" : "_doc",

            "_id" : "1",

            "_version" : 4,

            "result" : "updated",

            "_shards" : {

              "total" : 2,

              "successful" : 1,

              "failed" : 0

            },

            "_seq_no" : 20,

            "_primary_term" : 2,

            "status" : 200

          }

        }

      ]

    }


    2번을 고치고 1번을 고치도록 했는데, 음... 그렇다.

    ~]$ curl -X GET "localhost:9200/customer/_doc/1?pretty"

    {

      "_index" : "customer",

      "_type" : "_doc",

      "_id" : "1",

      "_version" : 4,

      "found" : true,

      "_source" : {

        "name" : "John Doe becomes Jane Doe122434"

      }

    }


    1 잘 고쳐짐.


    일단 여기까지.


+ Recent posts