{"id":282602,"date":"2016-12-16T12:10:12","date_gmt":"2016-12-16T09:10:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282602"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282602","title":{"rendered":"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Aerospike \u043d\u0430 scala \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0433\u0438\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432"},"content":{"rendered":"<h1 id=\"rabota-s-aerospike-na-scala-pri-pomoschi-magii-makrosov\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Aerospike \u043d\u0430 scala \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0433\u0438\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432<\/h1>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e89\/09d\/519\/e8909d5198454cd8bfa681f747f3b43d.png\" alt=\"N|Solid\"\/><\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u0435 \u0431\u0438\u0433\u0434\u0430\u0442\u044b \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 Aerospike. \u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0434\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Scala, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043e \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u044b\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u0441 \u0431\u044b\u043b \u0434\u0436\u0430\u0432\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0441\u0430\u043c\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 aerospike.com (<a href=\"http:\/\/www.aearospike.com\/docs\/client\/java\">http:\/\/www.aearospike.com\/docs\/client\/java<\/a>). \u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0441\u043a\u0430\u043b\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445) \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0430\u044d\u0440\u043e\u0441\u043f\u0430\u0439\u043a\u043e\u0432\u0441\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u0438 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Aerospike, \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c <a href=\"http:\/\/docs.scala-lang.org\/overviews\/macros\/overview.html\">\u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438<\/a>.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4 id=\"nemnogo-pro-aerospike\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e Aerospike<\/h4>\n<p>  <\/p>\n<p><a href=\"http:\/\/www.aerospike.com\/russian\/\">Aerospike<\/a> \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f schema-less key-value \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041e\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u0430\u043d\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u043a\u044d\u0448\u0435\u0439 \u0438 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0430. \u0411\u0430\u0437\u0430 \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0435\u0451 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443.<\/p>\n<p>  <\/p>\n<p>\u041e \u043c\u043e\u0434\u0435\u043b\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b namespace \u0438 setName \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0430 \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0432 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0438\u043d\u0430\u0445. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432: <code>Integers, Strings, Bytes, Doubles, Lists, Maps, Sorted Maps, GeoJSON<\/code>. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0442\u0438\u043f \u0431\u0438\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438, \u0437\u0430\u043f\u0438\u0441\u0430\u0432, \u0441\u043a\u0430\u0436\u0435\u043c, <code>Integer<\/code>, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439. \u0414\u0440\u0430\u0439\u0432\u0435\u0440\u044b, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0431\u0430\u0437\u044b, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0438\u0437\u0440\u044f\u0434\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e.<\/p>\n<p>  <\/p>\n<h4 id=\"pro-sozdanie-dsl\">\u041f\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 DSL<\/h4>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e DSL, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e \u0431\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0441\u0438\u043b\u0438\u0439 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u0438\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d Aerospike Java Client \u0432\u0435\u0440\u0441\u0438\u0438 3.3.1 (\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 www.aerospike.com, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0435\u0441\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/aerospike\/aerospike-client-java\">\u0413\u0438\u0442\u0445\u0430\u0431\u0435<\/a>), \u043d\u0435\u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438 \u0431\u0438\u043d\u0430\u043c\u0438 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>com.aerospike.client<\/code>. Java Client \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0430\u0437\u043e\u0439 \u043a\u0430\u043a \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c, \u0442\u0430\u043a \u0438 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 <code>com.aerospike.client.async.AsyncClient<\/code>. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">val client = new AsyncClient(new AsyncClientPolicy, hosts.map(new Host(_, port)): _*)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 <code>hosts<\/code> \u2014 \u044d\u0442\u043e <code>List[String]<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0445\u043e\u0441\u0442\u044b \u0432\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u044b, \u0430 <code>port<\/code> \u2014 \u043f\u043e\u0440\u0442 \u0442\u0438\u043f\u0430 <code>Int<\/code> (\u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 3000).<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0432\u044b\u043a\u0438\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">scala&gt; new AsyncClient(new AsyncClientPolicy, List().map(new Host(_, port)): _*) com.aerospike.client.AerospikeException$Connection: Error Code 11: Failed to connect to host(s):<\/code><\/pre>\n<p>  <\/p>\n<h5 id=\"tablica-sootvetstviy-tipov-v-dsl-java-client-i-baze-dannyh\">\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0439 \u0442\u0438\u043f\u043e\u0432 \u0432 DSL, Java CLient \u0438 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h5>\n<pre><code class=\"scala\">| Scala         | Java Client   | Aerospike     | |-------------- |-------------- |-----------    | | Int           | IntegerValue  | Integer       | | Long          | LongValue     | Integer       | | String        | StringValue   | String        | | Boolean       | BooleanValue  | Integer       | | Float         | FloatValue    | Double        | | Double        | DoubleValue   | Double        | | Seq           | ListValue     | List          | | Map           | MapValue      | Map           | | Char          | StringValue   | String        | | Short         | IntegerValue  | Integer       | | Byte          | IntegerValue  | Integer       | | HList         | MapValue      | Map           | | case class T  | MapValue      | Map           |<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439. \u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u0431\u044b\u043b\u0430 \u043f\u0440\u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0448\u0435\u043d, \u043d\u043e \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0441 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u2014 \u044d\u0442\u043e \u0434\u043e\u043b\u0433\u043e \u0438 \u0434\u043e\u0440\u043e\u0433\u043e. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u043a\u043e\u043c\u043f\u0430\u0439\u043b-\u0442\u0430\u0439\u043c \u0440\u0435\u0444\u043b\u0435\u043a\u0448\u0435\u043d\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0435\u0449\u0435 \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0430\u0448\u0435\u0439 DSL \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441 \u0431\u0430\u0437\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0431\u0438\u043d\u043e\u0432, \u0430 \u0432\u0441\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430 \u043d\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u044b. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430 \u0438 \u0443\u0431\u0435\u0440\u0435\u0447\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0442 \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u043c\u043e\u0433\u043e Aerospike. \u041c\u044b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 Aerospike \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0435\u0435 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u043a\u043b\u044e\u0447\u0443. \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>Put<\/code>. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430: \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 <code>com.aerospike.client.Key<\/code>, \u0430 \u0431\u0438\u043d\u043e\u0432 \u0432 <code>com.aerospike.client.Bin<\/code>.<br \/>  \u041f\u0443\u0441\u0442\u044c \u043a\u043b\u044e\u0447 \u0431\u0443\u0434\u0435\u0442 <code>String<\/code>, \u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u0431\u0443\u0434\u0435\u043c \u0431\u0438\u043d\u044b \u0442\u0438\u043f\u043e\u0432 <code>String, Int, Boolean<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">import com.aerospike.client.Key def createStringKey(namespace: String, setName: String, value: String): Key =    new Key(namespace, setName, new StringValue(value))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438 \u0431\u0438\u043d\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">import com.aerospike.client.Value.{IntegerValue, StringValue, BooleanValue}  def createStringBin(name: String, value: String): Bin = new Bin(name, new StringValue(value)) def createIntBin(name: String, value: Int): Bin = new Bin(name, new IntegerValue(value)) def createBooleanBin(name: String, value: Boolean): Bin = new Bin(name, new BooleanValue(value))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043d\u0430 java (\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0441 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432):<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public void put(WritePolicy policy, Key key, Bin... bins) throws AerospikeException;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u0437\u043e\u0432\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">import com.aerospike.client.policy.WritePolicy  client.put(new WritePolicy, createStringKey(&quot;namespace&quot;, &quot;setName&quot;, &quot;keyValue1&quot;),    Seq(createStringBin(&quot;binName1&quot;, &quot;binValue1&quot;), createStringBin(&quot;binName2&quot;, &quot;binValue2&quot;)): _*) client.put(new WritePolicy, createStringKey(&quot;namespace&quot;, &quot;setName&quot;, &quot;keyValue2&quot;),    Seq(createIntBin(&quot;binName1&quot;, 2), createIntBin(&quot;binName2&quot;, 4)): _*) client.put(new WritePolicy, createStringKey(&quot;namespace&quot;, &quot;setName&quot;, &quot;keyValue3&quot;),    Seq(createBooleanBin(&quot;binName1&quot;, true), createBooleanBin(&quot;binName2&quot;, false)): _*)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u043e, \u043f\u0440\u0430\u0432\u0434\u0430? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\"> def createKey[T](ns: String, sn: String, value: T): Key = {    val key = value match {      case s: String =&gt; new StringValue(s)      case i: Int =&gt; new IntegerValue(i)      case b: Boolean =&gt; new BooleanValue(b)      case _ =&gt; throw new Exception(&quot;Not implemented&quot;)    }    new Key(ns, sn, key)  }   def createBin[T](name: String, value: T): Bin = {    value match {      case s: String =&gt; new Bin(name, new StringValue(s))      case i: Int =&gt; new Bin(name, new IntegerValue(i))      case b: Boolean =&gt; new Bin(name, new BooleanValue(b))      case _ =&gt; throw new Exception(&quot;Not implemented&quot;)    }  }   def putValues[K, B](client: AsyncClient, namespace: String, setName: String,                      keyValue: K, bins: Seq[(String, B)])(implicit wPolicy: WritePolicy): Unit = {    client.put(wPolicy, createKey(namespace, setName, keyValue), bins.map(b =&gt; createBin(b._1, b._2)): _*)  }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>createKey<\/code> \u0438 <code>createBin<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u043c <del>\u043c\u0430\u0433\u0438\u0438<\/del> \u0438\u043c\u043f\u043b\u0438\u0441\u0438\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">KeyWrapper: [K =&gt; Key] BinWrapper: [B =&gt; Bin]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">case class SingleBin[B](name: String, value: B)  def putValues[K, B](client: AsyncClient, key: K, value: SingleBin[B])(implicit kC: KeyWrapper[K],  bC: BinWrapper[B], wPolicy: WritePolicy): Unit = client.put(wPolicy, kC(key), bC(value))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 <code>WritePolicy<\/code> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u0438. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0435\u0433\u043e \u0442\u0430\u043a <code>scala new WritePolicy<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0430\u043c\u044b\u043c \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0440\u0430\u043f\u043f\u0435\u0440\u043e\u0432 \u0432\u0441\u0435\u0445 \u0442\u0438\u043f\u043e\u0432. \u041d\u043e \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432? \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u044b.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"http:\/\/docs.scala-lang.org\/overviews\/quasiquotes\/intro.html\">\u043a\u0432\u0430\u0437\u0438\u043a\u0432\u043e\u0442<\/a>. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043a\u043b\u044e\u0447\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\"> trait KeyWrapper[KT] {     val namespace: String = &quot;&quot;    val setName: String = &quot;&quot;     def apply(k: KT): Key     def toValue(v: KT): Value = v match {      case b: Int =&gt; new IntegerValue(b)      case b: String =&gt; new StringValue(b)      case b: Boolean =&gt; new BooleanValue(b)      case _ =&gt; throw new Exception(&quot;not implemented&quot;)    }  }   object KeyWrapper {     implicit def materialize[T](implicit dbc: DBCredentials): KeyWrapper[T] = macro impl[T]     def impl[T: c.WeakTypeTag](c: Context)(dbc: c.Expr[DBCredentials]): c.Expr[KeyWrapper[T]] = {      import c.universe._      val tpe = weakTypeOf[T]       val ns = reify(dbc.splice.namespace)      val sn = reify(dbc.splice.setname)       val imports =        q&quot;&quot;&quot;          import com.aerospike.client.{Key, Value}          import collection.JavaConversions._          import com.aerospike.client.Value._          import scala.collection.immutable.Seq          import ru.tinkoff.aerospikescala.domain.ByteSegment          import scala.util.{Failure, Success, Try}         &quot;&quot;&quot;       c.Expr[KeyWrapper[T]] {        q&quot;&quot;&quot;        $imports        new KeyWrapper[$tpe] {          override val namespace = $ns          override val setName = $sn          def apply(k: $tpe): Key = new Key(namespace, setName, toValue(k))        }       &quot;&quot;&quot;      }    }  }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 <code>DBCredentials<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 namespace \u0438 setName.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fc8\/df3\/0eb\/fc8df30eba7340d08b65b81728bdd79b.gif\" alt=\"N|Solid\"\/><\/p>\n<p>  <\/p>\n<p>\u0421 \u0431\u0438\u043d\u0430\u043c\u0438 \u0443 \u043d\u0430\u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0435, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 Aerospike. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public Record get(Policy policy, Key key) throws AerospikeException;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public Record(      Map&lt;String,Object&gt; bins,      int generation,      int expiration   )<\/code><\/pre>\n<p>  <\/p>\n<p>\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 <code>Map&lt;String,Object&gt; bins<\/code>. \u0422\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 (\u0441\u043c. \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0439). \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430, \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0430\u043d\u0435\u0435, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0443\u044e \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u0432\u044d\u043b\u044c\u044e \u0438\u0437 \u0431\u0430\u0437\u044b. \u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 <code>bins<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>java.util<\/code> \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <code>scala.collection<\/code>.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u0434\u043b\u044f \u0431\u0438\u043d\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">trait BinWrapper[BT] {   import com.aerospike.client.Value._  import com.aerospike.client.{Bin, Record, Value}  import scala.collection.JavaConversions._  import scala.collection.immutable.Map  import scala.reflect.runtime.universe._   type Singleton = SingleBin[BT]  type Out = (Map[String, Option[BT]], Int, Int)   def apply(one: Singleton): Bin = {    if (one.name.length &gt; 14) throw new IllegalArgumentException(&quot;Current limit for bean name is 14 characters&quot;)    else new Bin(one.name, toValue(one.value))  }   def toValue(v: BT): Value = v match {    case b: Int =&gt; new IntegerValue(b)    case b: String =&gt; new StringValue(b)    case b: Boolean =&gt; new BooleanValue(b)    case _ =&gt; throw new Exception(&quot;not implemented&quot;)  }   def apply(r: Record): Out = {    val outValue: Map[String, Option[BT]] = {      val jMap = r.bins.view collect {        case (name, bt: Any) =&gt; name -&gt; fetch(bt)      }      jMap.toMap    }    if (outValue.values.isEmpty &amp;&amp; r.bins.nonEmpty) throw new ClassCastException(      s&quot;Failed to cast ${weakTypeOf[BT]}. Please, implement fetch function in BinWrapper&quot;)    else (outValue, r.generation, r.expiration)  }   def fetch(any: Any): Option[BT] }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>apply<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>Record<\/code> \u2014 \u0442\u0443\u0442 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0451 \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0438\u043f\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">object BinWrapper {   implicit def materialize[T]: BinWrapper[T] = macro materializeImpl[T]   def materializeImpl[T: c.WeakTypeTag](c: blackbox.Context): c.Expr[BinWrapper[T]] = {    import c.universe._    val tpe = weakTypeOf[T]    val singleton = weakTypeOf[SingleBin[T]]    val out = weakTypeOf[(Map[String, Option[T]], Int, Int)]    val tpeSt = q&quot;${tpe.toString}&quot;     val fetchValue = tpe match {      case t if t =:= weakTypeOf[String] =&gt; q&quot;&quot;&quot;override def fetch(any: Any): Option[$tpe] = any match {        case v: String =&gt; Option(v)        case oth =&gt; scala.util.Try(oth.toString).toOption      } &quot;&quot;&quot;      case t if t =:= weakTypeOf[Boolean] =&gt; q&quot;&quot;&quot;override def fetch(any: Any): Option[$tpe] = any match {        case v: java.lang.Long =&gt; Option(v == 1)        case _ =&gt; None      } &quot;&quot;&quot;      case t if t =:= weakTypeOf[Int] =&gt; q&quot;&quot;&quot;override def fetch(any: Any): Option[$tpe] = any match {        case v: java.lang.Long =&gt; Option(v.toInt)        case oth =&gt; scala.util.Try(oth.toString.toInt).toOption      } &quot;&quot;&quot;      case t if t.toString.contains(&quot;HNil&quot;) || t.toString.contains(&quot;HList&quot;) =&gt;        q&quot;&quot;&quot;override def fetch(any: Any): Option[$tpe] = any match {              case m: java.util.HashMap[Any, Any] =&gt;              val newList = castHListElements(m.asScala.values.toList, $tpeSt)              newList.toHList[$tpe]              case oth =&gt; None            } &quot;&quot;&quot;      case _ =&gt; q&quot;&quot;&quot;&quot;&quot;&quot;    }     val imports =      q&quot;&quot;&quot;         import java.util.{List =&gt; JList, Map =&gt; JMap}         import com.aerospike.client.{Bin, Record, Value}         import com.aerospike.client.Value.{BlobValue, ListValue, MapValue, ValueArray}         import scala.collection.JavaConversions._         import scala.collection.JavaConverters._         import shapeless.{HList, _}         import shapeless.HList.hlistOps         import syntax.std.traversable._         ....       &quot;&quot;&quot;     c.Expr[BinWrapper[T]] {      q&quot;&quot;&quot;      $imports       new BinWrapper[$tpe] {        override def apply(one: $singleton): Bin = {           if (one.name.length &gt; 14) throw new IllegalArgumentException(&quot;Current limit for bean name is 14 characters&quot;)           else new Bin(one.name, toValue(one.value))         }        override def apply(r: Record): $out = {           val outValue: Map[String, Option[$tpe]] = {           val jMap = r.bins.view collect {            case (name, bt: Any) =&gt;            val res = fetch(bt)            if (res.isEmpty &amp;&amp; r.bins.nonEmpty) throwClassCast($tpeSt) else name -&gt; res           }          jMap.toMap          }          (outValue, r.generation, r.expiration)        }        $fetchValue      }     &quot;&quot;&quot;    }  } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0437\u0430 \u043d\u0430\u0441 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u2014 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0431\u0438\u043d\u043e\u0432.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b40\/f8b\/40a\/b40f8b40adc84b0299ebe033fed87236.gif\" alt=\"N|Solid\"\/><\/p>\n<p>  <\/p>\n<p>\u0421 <code>Quasiquotes<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u0435\u0433\u043a\u043e: \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435, \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u0435\u0439 \u043d\u0435\u0442. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 <code>Quasiquotes<\/code> \u043c\u0435\u0442\u043e\u0434\u0430\u0445, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>imports<\/code> \u0432 \u043e\u0431\u043e\u0438\u0445 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0441\u0451, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441-\u043e\u0431\u0435\u0440\u0442\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">class SpikeImpl(client: IAsyncClient) {   def putValue[K, B](key: K, value: SingleBin[B])(implicit kC: KeyWrapper[K], bC: BinWrapper[B]): Unit = {    val wPolicy = new WritePolicy    client.put(wPolicy, kC(key), bC(value))  }    def getByKey[K, B](k: K)(implicit kC: KeyWrapper[K], bC: BinWrapper[B]): Option[B] = {    val policy = new Policy    val record = client.get(policy, kC(k))    bC.apply(record)._1.headOption.flatMap(_._2)  } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">import shapeless.{HList, _} import shapeless.HList.hlistOps import scala.reflect.macros.blackbox._ import scala.language.experimental.macros  object HelloAerospike extends App {   val client = new AsyncClient(new AsyncClientPolicy, hosts.map(new Host(_, port)): _*)  val database = new SpikeImpl(client)  implicit val dbc = DBCredentials(&quot;namespace&quot;, &quot;setName&quot;)     database.putValue(&quot;key&quot;, SingleBin(&quot;binName&quot;, 123 :: &quot;strValue&quot; :: true :: HNil))    val hlistBin = database.getByKey[String, Int :: String :: Boolean :: HNil](&quot;key&quot;)      .getOrElse(throw new Exception(&quot;Failed to get bin value&quot;))    println(&quot;hlistBin value = &quot; + hlistBin)  }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0431\u0430\u0437\u0443:<\/p>\n<p>  <\/p>\n<pre><code>Mac-mini-administrator-5:~ MarinaSigaeva$ ssh user@host user@host's password: Last login: Wed Nov 23 19:41:56 2016 from 1.1.1.1 [user@host ~]$ aql Aerospike Query Client Version 3.9.1.2 Copyright 2012-2016 Aerospike. All rights reserved. aql&gt; select * from namespace.setName +------------------------------------------+ | binName                                  | +------------------------------------------+ | MAP('{&quot;0&quot;:123, &quot;1&quot;:&quot;strValue&quot;, &quot;2&quot;:1}')  | +------------------------------------------+ 1 row in set (0.049 secs) aql&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u0435\u043b\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"scala\">[info] Compiling 1 Scala source to \/Users\/Marina\/Desktop\/forks\/playground\/target\/scala-2.11\/classes... [info] Running HelloAerospike hlistBin value = 123 :: strValue :: true :: HNil [success] Total time: 0 s, completed 23.11.2016 20:01:44<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f scala \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e, \u0447\u0435\u043c java \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430. \u041a\u043e\u0434 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e DSL \u0432\u044b\u043b\u043e\u0436\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/aerospike-scala\">\u0413\u0438\u0442\u0445\u0430\u0431\u0435<\/a> \u0441 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/aerospike-scala\/blob\/master\/README.md\">how to<\/a> \u0438 <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/aerospike-scala\/tree\/master\/cookbook\">\u043a\u0443\u043a\u0431\u0443\u043a\u043e\u043c<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f.<br \/>  \u0412 \u0441\u0432\u0435\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (<a href=\"https:\/\/www.lightbend.com\/blog\/scala-2-12-released\">scala 2.12 released<\/a>) \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e <a href=\"http:\/\/scalameta.org\/\">scala-meta<\/a>.<br \/>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044d\u0442\u043e\u0442 \u043e\u043f\u044b\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/317742\/\"> https:\/\/habrahabr.ru\/post\/317742\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<h1 id=\"rabota-s-aerospike-na-scala-pri-pomoschi-magii-makrosov\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Aerospike \u043d\u0430 scala \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0433\u0438\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432<\/h1>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e89\/09d\/519\/e8909d5198454cd8bfa681f747f3b43d.png\" alt=\"N|Solid\"\/><\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u0435 \u0431\u0438\u0433\u0434\u0430\u0442\u044b \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 Aerospike. \u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0434\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Scala, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043e \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u044b\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u0441 \u0431\u044b\u043b \u0434\u0436\u0430\u0432\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0441\u0430\u043c\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 aerospike.com (<a href=\"http:\/\/www.aearospike.com\/docs\/client\/java\">http:\/\/www.aearospike.com\/docs\/client\/java<\/a>). \u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0441\u043a\u0430\u043b\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445) \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0430\u044d\u0440\u043e\u0441\u043f\u0430\u0439\u043a\u043e\u0432\u0441\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u0438 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Aerospike, \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c <a href=\"http:\/\/docs.scala-lang.org\/overviews\/macros\/overview.html\">\u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438<\/a>.<\/p>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-282602","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282602"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282602\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}