appengine java night #3ã«è¡ã£ã¦ããã #appengine #ajn3
ããã¼ä»åãæ¿ãã¦ãããããã£ãã§ããããããªæ¿ã人ãéã¾ãApp Engineåå¼·ä¼ã¯ãã¶ãæ¥æ¬ã§ãããä¸çªãªããããªããã¨æãã¾ãã
ã½ã¼ã¹ãè¦ããªã質åãé£ã¶é£ã¶ï¼ãããæ®éã®è³ªåãããªããã§ããããè£ã§ã¯ã©ã¦ããã©ããã風ã«ãªã£ã¦ãããã話ããããããããªåå¼·ä¼ã
ä»åã¯ã°ãªã¼ã®ä¸äºããã«ä¼å ´ããåããã¾ãããä¸äºããä¼å ´æä¾ãããã¨ããããã¾ããããã11:30ãããã¾ã§ä»ãåã£ã¦ããããªãã¦ããããããã
ã
ãããªãã
- æ¬ç·¨
- ç§ï¼å®éã«ä½ã£ã¦ããã£ãApp Engineã®å°ã£ãã¨ãã
- 竹嵜さんï¼ã¶ãã¦ãæµ ã¹ã±ã¼ã©ãã«ã¢ããªã®ä½ãæ¹
- LTï¼Lightning Talk?, Long Talk?)
- @WdWeaverãã:ã¹ã±ã¼ã«ã¢ã¦ãã®çå®ï¼
- @tmatsuoããï¼Kay (Python çã® framework) ã«ã¤ãã¦
- id:marblejenkaããï¼makeSyncCallã§ãããã試ãã¦ã¿ã
å®éã«ä½ã£ã¦ããã£ãApp Engineã®å°ã£ãã¨ãã
ç§ãçºè¡¨ããã¦ããã ãã¾ãããæ©ä¼ãä¸ãã¦ãããçããã«æè¬ãã¾ãã
以ä¸ã¯è³æã®è£è¶³
- ãããå¦çã30ç§ä»¥å
- AppEngineã¯joinã§ããªããã¨ã移è¡ã®å£ã®ããã«èªããã¦ããã©ãããå¦çã®å£ã®æ¹ãè¾ã
- ãã®å£ãè¶ããã¨åæã«é«éåããã¦ã¹ã±ã¼ã«ããã¢ããªã«ãªã
- TaskQueueã§é«éå + äºåKeyæ¡çª
- TaskQueueã使ãå ´åã¯äºåKeyæ¡çªã®æ¹æ³ã¯ç§ã®ä¸ã§ã¯éæ¿
- ãã®ä»çµã¿ã¯å®ã¯ãã¹ã¿åãè¾¼ã¿ã«ããããã
- App Engineã§ã¯ã¾ã ãã¼ã¿ã®ã¤ã³ãã¼ããå¼±ãã®ã§ãã¸ãã¯ã§ç»é²ãããã¨ã«ãªãã
- csvãã«ã¼ãããã¦ä¸ã¬ã³ã¼ãã«å¯¾ãã¦è³æã¨åãèãã§ï¼TaskQueueã§å¦çãã¦ãã¹ã¿åãè¾¼ã¿ããã®ããããã
- ãããçµäºã®å¤æ
- å®ã¯ã«ã¦ã³ãã使ç¨ããªãæ¹æ³ãããã
- äºåKeyæ¡çªã®ä»çµã¿ã使ã£ã¦Keyãæ¡çªãã
- æ¡çªããKeyããã£ãã·ã¥ãDatastoreãTaskQueueã®ãã©ã¡ã¼ã¿ãªã©ã§ä¿æãã¦ãã
- ãã¨ã¯ãã®Keyã«å¯¾ããEntityããã¹ã¦DatastoreService#getã§åå¾ã§ããã°å ¨é¨ããããçµãã£ãã¨ããäºããããã
- 注æç¹ã¯ãã£ãã·ã¥ãªããã£ãã·ã¥ãæ¶ãã¦ããªãããTaskQueueã®å ´åã¯ãã©ã¡ã¼ã¿ã¯10kã®ãµã¤ãºå¶éããããã¨ã
- ãã®æ¹æ³ãå®ã¯ä¸çªã®ããããã ã£ããããã®ã ãããã¼ã¸æ§æã®é½åä¸èª¬æã§ããªãã£ãã
- å®ã¯ã«ã¦ã³ãã使ç¨ããªãæ¹æ³ãããã
- ã¡ã¼ã«éä¿¡ã§äºééä¿¡ã®å¯è½æ§ãããã«ã¤ãã¦è³æã§ã¯èª¬æãè¨è¼ãã¦ããªãã®ã§è£è¶³ããã@shin1ogawaãããã°ã£ã¡ã解説ãã¦ããã¦ããããããããã¨
@shin1ogawa Datastoreã«ã¡ã¼ã«ããã¥ã¼ï¼æªéä¿¡ç¶æ ï¼ONï¼âã¡ã¼ã«éä¿¡âOKãªãæªéä¿¡ç¶æ ãOFFã«è¨å®â¦ã¨ããæ¹æ³ã ã¨ãæå¾ã®æªéä¿¡ç¶æ ãOFFã«ããDatastoreã®æä½ã失æããæã«ãåãã¡ã¼ã«ãè¤æ°åéä¿¡ããã¦ãã¾ãå¯è½æ§ãããã #ajn3
-
- ããã¯å¥ã«ãã®ããæ¹ãæªãã¨è¨ãããã§ã¯ãªãã¡ã¼ã«éä¿¡ã®å ´åã¯ä¸è¨ã®ãããããã¨ãå¿
è¦ãããã¨ããäº
- MailApiãã¨ã©ã¼æã«ã¡ã¼ã«ãããªãã 0 or 1åã®ã¡ã¼ã«éä¿¡ã
- Datastoreãã¨ã©ã¼æã«äºééä¿¡ããããã1å以ä¸ã®ã¡ã¼ã«éä¿¡ã
- ããã¯å¥ã«ãã®ããæ¹ãæªãã¨è¨ãããã§ã¯ãªãã¡ã¼ã«éä¿¡ã®å ´åã¯ä¸è¨ã®ãããããã¨ãå¿
è¦ãããã¨ããäº
ããã§ä¸çªãã£ãããªã®ã¯Datastoreãèªã¿åãå°ç¨ï¼CapabilityDisabledExceptionï¼ã«ãªããã¨ãããäºãgoogleãã¡ã³ããã³ã¹æã«ã¯ããããäºãèµ·ããããã ãããã«å¯¾ãã対çããã¦ããªãã£ãå ´åã«å¾è ã®æ¹éãåã£ãã¢ããªã¯å¤§éã®ã¡ã¼ã«éä¿¡ã«ãªãã
- ã¡ã¼ã«éä¿¡ã§ã¹ã±ã¼ã«ããªã件ã«ã¤ãã¦
- 課éè¨å®ãããã°1åéã§32åã®å¶éã¯ç°¡åã«è¶ ãããããããããå®ã¯ããã¦ãã®å ´åãéã¯ããããªãã課é対象ã«ãªãã®ã¯24æéããã170ä¸å以ä¸ã®ã¡ã¼ã«ãéä¿¡ããããã«ãªã£ã¦ãããªã®ã ã
- ã¡ã¼ã«åæ°ãã³ã¼ãã£ã³ã°ããã®ã¯ãããªããå¶éã«ãããã¦ã½ã¼ã¹ãå¤æ´ãããªãã¦App Engineã®èªåã¹ã±ã¼ã«ã¢ã¦ãã®èãããééã£ã¦ãããããã¡ã¼ã«ã®æ£ããå®è£ ã¯TaskQueueãç¨ããã¡ã¼ã«éä¿¡ã ã¨æããå½åã¯TaskQueueããªãã£ãäºã¨ã¨ã©ã¼(OverQuotaException)ã¯åºãªãããã«å®è£ ãã¹ãã ã¨èãã¦ããäºãããã®å®è£ ã«ãªã£ã¦ãããããããApp Engineã使ã£ã¦ãããã®ã¯ã¨ã©ã¼ã¯åºããã®ã¨ãã¦èãã¦ã¨ã©ã¼ãåºãããªãã©ã¤ããããã«å®è£ ããã®ãæ£ããApp Engineã®ä½¿ãæ¹ãããªããã¨èããæ¹ãã¦ããã
- Entity Group
- é¨ã®æ¥ãã¼ãã§ã¯Userã¨MailQueueã¯Entity Groupã«ãã
- Entity Groupãã©ããªæã«ä½¿ã£ã¦ããã®ããã©ããªæã«åé¡ãªã®ããå°ãã¯ä¼ãããããã¨æã£ã¦è³æã¯è¨è¼ãããç§ã¯ajn1ã§EntityGroupãKeyã§æ§æããã¦ãããã¨ã«è¡æãåãããã¾ã 使ãã«ã¯è³ããªãã£ããåããããããªããã®ã¯ä½¿ããªãã¨æã£ãã®ã ãKeyã®æ§æã¨æä»å¦çã®åé¡çãç解ãããã¨ã§Userã¨MailQueueã¯Entity Groupã«ãã¦ãããã¨ããçµè«ãåºããã
- æå¾ã«ã¾ã¨ã
- App Engineã«ã¤ãã¦è©±ãã«ããã£ã¦å¶ç´ã¯ããã¦ã¯éããªããããããå¶ç´ãdisã£ã¦ä½¿ããªãã¨ããã®ã§ã¯ãªãå¶ç´ãã«ã¼ã«ã ã¨æã£ã¦ä¹ãè¶ããã¨åå¼·ã«ãªãé¨åãå¤ããã£ã¦ã¿ããªã使ã£ãããããã¨ããæãã§è¨è¼ããã
- ãå¶ç´ã§ã¯ãªãã«ã¼ã«ãã«ã¼ã«ãå®ããªããããã°ã©ã ããã²ã¼ã ããã®ã²ã¼ã ã¯å¿ ãéçºè ãæé·ãããã
- éçããµãã«ã¼ãã«ã¼ã«ããªãã¨ãããããã²ã¼ã ã«ãªããªãããï¼ã¨ãéãããã«ã¼ã«ã®ä¸ã§ã½ããã¦ã§ã¢ã§ã©ãã§ãããã競ããããªæè¦ããã£ã¦ä½¿ã£ã¦ã¿ãã®ã¯ã©ãã ãããï¼ã¨ããæãããã£ãã
- App Engineã«ã¤ãã¦è©±ãã«ããã£ã¦å¶ç´ã¯ããã¦ã¯éããªããããããå¶ç´ãdisã£ã¦ä½¿ããªãã¨ããã®ã§ã¯ãªãå¶ç´ãã«ã¼ã«ã ã¨æã£ã¦ä¹ãè¶ããã¨åå¼·ã«ãªãé¨åãå¤ããã£ã¦ã¿ããªã使ã£ãããããã¨ããæãã§è¨è¼ããã
- hidemonããã®ã»ãã·ã§ã³ä¸ã«ãã£ã話ã®ããã¾ã¨ã
(Memcache ã®low level API)
contains ã¯ãããªãã»ãããã by ã²ããã
(containsãããã¨ãããã¯ã¼ã¯ã¢ã¯ã»ã¹ãçºçãã¦é ããªãï¼
JDOã ã¨é¢é£ããã¨ã«åæã«entity groupãä½ã£ã¦ãã¾ã£ã¦ãã¦æ··ä¹±ã®ãã¨ï¼byã²ããã
transaction éå§å¾æåã®get/put㧠ãã®ã¨ãã®ã¿ã¤ã ã¹ã¿ã³ããã©ããã«åã£ã¦ããï¼
commit ã®ã¨ãã«åã£ã¦ãããã¿ã¤ã ã¹ã¿ã³ãã¨åããã©ãããæ¯è¼ããï¼
ancestor query 以å¤ã®queryã§ã¯transactionãããããªãï¼keyã«å¯¾ããgetã ã¨ã ãtransactionã«ãªãï¼
queryã¯æ¬æ¥è¤æ°ã®è¡ãç¸æã«ãã¦ããã®ã§ï¼ããããã©ã®entityã°ã«ã¼ãã«ããããqueryãªã®ãå®ç¾©ã§ããªãããï¼
ancestor query㯠entity groupã«å¯¾ããqueryãªã®ã§ï¼å®ç¾©ã§ããããï¼
KeyRange keys = service.allocateIds(KIND, 1);
<- ããï¼çµæ§éãï¼ã¾ã¨ãã¦ãã£ãã»ããããï¼1件20msãããï¼
String key = KeyFactory.keyToString(keys.getStart())
é¨ã®æ¥ãã¼ãã®ç´¹ä»
ã¡ãã£ã¨ãµã¤ãã®èª¬æã¨ãããã¾ãããªãã£ãã®ã§ã¡ãã£ã¨ã ãããã¦ä¸ããã
- é¨ã®æ¥ãã¼ãã¯æã®å¤©æ°äºå ±ãé¨ã®å ´åã«å¤©æ°äºå ±ãã¡ã¼ã«ãã¦ããããµã¼ãã¹ã§ã
- é¨ã®æ¥ãã¼ãã®ã³ã³ã»ãã
- ãµã¼ãã¹ã¯ç»é²ããã ãã§åããããäº
- ãµã¼ãããã®äººã«å¿ è¦ãªæ å ±ãå¿ è¦ãªã¿ã¤ãã³ã°ã§ã¦ã¼ã¶ã«æä¾ãã
- ã¦ã¼ã¶ã¯è½åçã«ä½ãããå¿ è¦ã¯ãªãããµã¼ãããã·ã¥åã
- ç»é²ã¯ç°¡åã«ããã
- 年代ã«é¢ä¿ãªã誰ã«ã§ãç´¹ä»ãããããµã¼ãã¹ã«ããã
ãªã©æããããã¾ã
- é¨ã®æ¥ãã¼ãã¯æ
£ããã¨ä¾¿å©ããå®æåºæ¥ãã¨æãã¾ãã
- æã¡ã¼ã«ãæ¥ã¦ããåãæã£ã¦è¡ãã
- 天æ°äºå ±ãè¦ãå¿ è¦ã¯ãªãã
- æ £ããã¨ã¡ã¼ã«æ¬æã¯ã©ãã§ãããã¦çä¿¡ããã£ããã§äººã®åããå¤ããã
ãããªãµã¼ãã¹ã§ãã
ç»é²ã¯ãã¡ããç¡æã§ãã®ã§è¯ãã£ãã使ã£ã¦ã¿ã¦ãã ããããã°ãè¦æã¯ãã¡ããã®ãã¨ãApp Engineã§ã©ããã£ã¦ããï¼ã¨ãããã°ã¬ã¹ãé ããã°å¬ããã§ãã
ãããããé¨ã®æ¥ãã¼ãã¯æã®ãããµã¼ãã¹ãªãã§ããææ è¾¼ãã¦ä½ã£ã¦ã¾ããéçºã®ãã£ããã¨ãªã£ãã¨ãã½ã¼ãããã£ã¦ãã¤ãã話ããæ©ä¼ãããã°è©±ãããã¨æãã¾ãã
ã¶ãã¦ãæµ ã¹ã±ã¼ã©ãã«ã¢ããªã®ä½ãæ¹
è³æã¯こちら
- ãããªããã¢ãåãããã
- 帳票ã¤ã¡ã¼ã¸ã®Webç»é¢ã§ãã®ã¾ã¾PDFãç·¨éãã¦ãããã®ããã«ä¿®æ£ã§ãããããã«ãã®ç»é¢ãPDFã¨ãã¦RESTã§åããã
- ãªããããï¼
- 帳票ã¤ã¡ã¼ã¸ã®Webç»é¢ã§ãã®ã¾ã¾PDFãç·¨éãã¦ãããã®ããã«ä¿®æ£ã§ãããããã«ãã®ç»é¢ãPDFã¨ãã¦RESTã§åããã
- 俳å¥ã®ã¨ãããç¬ããããã¾ãã
- ç§ããããããã¿èãããã
- ç®çéè¦ãGAEãã£ã¦ãã¨ç®çã¨å ¨ç¶é¢ä¿ãªããã¨ã«æéãããã¦ãã¾ãã
常ã«ç®çãå¿ãããª
GAEã§ä½ããã¨ãç®çã§ã¯ãªãï¼æ¬æ«è»¢åã«ãªããã¡ï¼
ãªãã¢ã«ã¹ã±ã¼ã«ããªããã°æå³ããªã
éããªããã°æå³ããªã
å®ããªããã°æå³ããªã
- ã¹ã±ã¼ã«ããããã«Kindãè¤æ°ãã«åãã¦ã¿ã
- ãã®çºæ³ã¯ãªãã£ããä¼å ´ããã¯Kindåããå¿ è¦ã¯ãªããã¨ãã声ããã£ããããããä»ã¯ä½ãããã®ãä½ãæªãã®ããããããªãããªã®ã§ããããªçºæ³ãè¦ã¦æè¦ã§ããå ´ãããã®ã¯æ¬å½ã«ã¹ãã
- ã¢ããªKeyï¼Revisionçªå·ã§ã¦ãã¼ã¯ã«ãªãããã«ãã
- ãã¼ã¿ãæ´æ°ãããã¨ãªã常ã«Insertããææ³
- ãã¹ã¦ã®æä½ããã°ã¨ãã¦æ®ãã
- å±¥æ´ç®¡çã«ãããã¬ã¼ãµããªãã£ã®åä¸ã«ã¤ãªããã
- å
é¨çµ±å¶ã®è¦³ç¹ãããããæ¡ã ã¨æãã
- Keyããã£ããç解ãã¦ãã¾ã使ãããªãã¦ãæã
- ãã©ã³ã¶ã¯ã·ã§ã³ã®éåæå®è¡ããµã¼ãã¹æåã®ã¢ã¼ããã¯ãã£ãªã©ãªã©
- å®éã«App Engineã§ããã¾ã§ä½ãè¾¼ãã§ããã®ã¯ã¾ã äºä¾ãå°ãªãããããªããã¨æããApp Engineã§ãããã¾ã§åºæ¥ããã¨ããäºãããããå®éã«ä»äºã§ãã£ã¦ãã人ã®è©±ãèããã®ã¯ã¨ã¦ãããã«ãªãã
- ãã ããã®é¨åã¯ã½ã¼ã¹ã¬ãã«ã§ã©ã®ããã«ããã®ããã¦ãã¦ãå
¬éãã¦ã»ããã¨ãããPDFã®ã¨ããã¯å
ç·ããããã
- PDFæä½ã®æ¢åã©ã¤ãã©ãªã¯GAEã§ã¯ä½¿ããªãäºãå¤ãã®ã§ãã¦ãã¦ãéãããã¨ãã
- Memcacheã¯ããã¾ãæ©ããªãï¼
- Memcacheã®GET/PUTã¯15msã»ã©ãDatastoreã®GET(20ms)
- Datastoreã®GETãæ³å以ä¸ã«æ©ãã®ã§GETã§å¯¾å¿ã§ããã¨ããã¯ãã£ãã·ã¥ã®å¿
è¦ãªã
- â»Datastoreã®Queryã¯620msã»ã©ãªã®ã§é ã
- GAEã®ãµã¼ãã¤ã³ã¹ã¿ã³ã¹ã¯ï¼ã¤ï¼
- ãã£ãããï¼ä¸å®ã®è² è·ãããç¶ããï¼ã¨ãµã¼ãã®ã¤ã³ã¹ã¿ã³ã¹ã¯å¢ãããããã
- Googleã«ç¸è«ããã¨è§£æ±ºãããã¨ãããã¥ã¼ã¹ããªã¥ã¼ãããã¨å¯¾å¿ã¯ãã£ã¨ãããããã
ã¹ã±ã¼ã«ã¢ã¦ãã®çå®ï¼
- 1ãªã¯ã¨ã¹ã30ç§ä»¥å
以å¤ã«10ç§å¶éã®è©±
- ãªã¯ã¨ã¹ãã¯ä¸æ¦ãªã¯ã¨ã¹ããã¥ã¼ã«ãã¾ãã
- ãã®ãã¥ã¼ã¯10ç§ä»¥å ã«ãªã¯ã¨ã¹ãå®è¡ãããªãã£ãå ´åã¯ãRequest was aborted after waiting too longãã®ã¨ã©ã¼ãåºã
- AppEngineã1instance/vmã1Thread/instance
- å®ã¯AppEngineã§ã¯1ã¤ã³ã¹ã¿ã³ã¹ã§1ãªã¯ã¨ã¹ãããåãä»ãã¦ããªãã®ã§ã¯ãªããã¨ããå 容ãã¶ãã¦ãããã®å 容ãèãã¦ã¿ãã¨ãã®ããã«æãããããã¯javaããã£ã¦ãã人ããè¦ãã¨ãã©ããã®ã¢ã¼ããã¯ãã£ã§ããã
- ã¹ã±ã¼ã«ããããã«ã¯ãã£ããéè¦
- ã©ãããã°ã¹ã±ã¼ã«ããã®ãã¯ä»ã®ã¨ããã¯ããã£ã¦ããªããè² è·ç¶æ ãç¶ãã¨ä½¿ç¨ã§ããã¤ã³ã¹ã¿ã³ã¹ãå¢ããããã§è² è·ç¶æ ãç¶ãããã¨ããã£ããã¨å¼ãã§ãããä¼å ´ã§ã¯ããã£ããããã£ãããããé£å¼ãã¦ãã¦ããªãé¢ç½ãã£ãã
Kay (Python çã® framework) ã«ã¤ãã¦
è³æã¯ã©ãããªï¼http://takashi-matsuo.blogspot.com/
- LLTVã§ã話ã®ãã£ãé£çãããã®ã§ãªãªã¼ã¹ã¿ã°ããã£ã話ã
- Kayã¯åä¾ã®ååããã¨ã£ãã
- ãã®è©±å人çã«ããªã好ãã§LLTVã§ã¨ã¦ãæéãåãããç§ãåä¾ã®ååã§ãªã«ããä½ããã¨æã£ãã
- Kayã¯åä¾ã®ååããã¨ã£ãã
pythonã§ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãAppEngineã®spin upãæ©ããããã«ãããªãã¨ãã¦ãã¨ããããªè©±ãèããã®ãæçã ã£ãã
makeSyncCallã§ãããã試ãã¦ã¿ã
è³æã¯こちら
æ½ããæ½ãä¸çªä¸ã¾ã§æ½ããã ããããããã¾ã§æ½ãç¶ããï¼ä¸çªä½ã¬ã¤ã¤ã¼ãæããã°ä½ãã§ããã®ããä½ãã§ããªãã®ãããããã¯ãã ã
ãããã¼å¤æ
ã§ããä¸è¨ã¯åè¨ã§ãã
- ãã»ã¨ãã©ã®æ¹ããåç¥ã®makeSyncCallã
- ãLowLevelAPIããã ããµã¤ï¼ãï¼low level apiã¯@marblejenkaã«ã¨ã£ã¦ã¯é«ã¬ãã«APIï¼
ã¿ããªãé
ãå
¥ã£ã¦ããããã話ãçãä¸ããããã¼ã¯ã«ãã£ãã¦ãããmakeSyncCallã¯ã¨ã³ã¸ãã¢å¿ããããæé«ã®ããã¡ãã§ããããã
ãããªå
容ãè¦ããã®ã¯ã¾ã¼ã¶ãããã®このフレームワークãèå³ãã人ã¯å¿
è¦ã§ãã
twitterã®ãã°
-
- はてなダイアリー
- @higayasuoããã®ã¤ã¶ãã
ãã®é æ ®ã®ãªãæ¿ãã #ajn3 ã¯ãªãªãã£ãè¯ããæªããã俺㯠#appengine ã«é¢ããé«ééè·¯ãã¤ãããããã ããã®ããã®åªåã¯æãã¾ãªã
App Engineã®é«ééè·¯ãajnã§ä½ãããï¼
-
- ãããããtwitterã§#appengineã®ããã·ã¥ã¿ã°ãã¤ããã¨ãã¶ãajnã®èª°ãããã¾ã£ã¦ãããã¨æãã¾ãã
blogã¬ã
-
- #ajn3に参加しました! - marblejediary
- ぶいてく: 【Google App Engine】 #ajn3資料
- appengine java night #3が終わりました - スティルハウスの書庫
- appengine night#3に参加してきた|ビープラウド社長のブログ
- 404 shin1のつぶやき ないわー Not Found: #appengine java night #3( #ajn3 )に参加した
- WdWeaver: appengine java night #3で発表してきたよ
- ぶいてく: 【クラウドコンピューティング】 クラウドとイノベーションについて
- 最近読んだ論文: appengine java night #3
ï¼éæ追å ãã¾ãï¼