Effort:
The estimated effort for the tendered prototyping project is low. We estimate it with 10 hours max, including documentation. In addition there should be 1 hour of Skype conference, where you present your solution via Skype.
Project:
Task 1: You set up a small OpenStack configuration on a virtual machine provided to you (RHEL on Xen).
The small OpenStack configuration is of your choice. Storage in this prototype is not necessary for user data. However, OpenStack identity will need to store user identification data.
The OpenStack environment has mandatorily to include
• The dashboard (simple configuration) to enable the cloud administrator to control his compute and networking resources.
• OpenStack Identity (from OpenStack Shared Services) enabling to create users and tenants and to define permissions for compute, storage and networking resources. It shall allow three users (user 1, 2and user 3) to read the output of sine wave software-as-a-service (see task 2). Exclusively user 3 shall also be able to define the input parameters. User 4 has no right to see, neither to input data. User names: user1, user2, user3, user4. Passwords: pass1, pass2, pass3, pass4.
Task 2: You virtualize one software program provided to you as a Web service
The software program, which we will provide to you is a little C++ program, reading the input parameters for amplitude and frequency and providing as output a simple sine wave.
Pls implement a low effort input GUI for the users entitled to input data (in the prototype it is only user 3). Just in case that you have designer capabilities, you can off course also provide nicely styled input GUI. In that case we would after submission of the result also discuss with you another job profile – the profile of a GUI designer.
Pls virtualize it as a Web service on OpenStack with a RESTful webAPI.
You can either provide a small purely text-based output GUI or provide a HTML5 Canvas GUI, simple, no framing coordinate system required. Users 1, 2, and 3 can see the output. User 3 does not have access to that GUI.
如果R腳本是通過JAVA啟動的,外部參數(shù)要如何傳到R中呢?
可以通過:
> Sys.setenv(R_TEST="testit")
> path <- Sys.getenv("R_TEST")
R_TEST
"testit"
> setwd($path)
R是一個用于統(tǒng)計分析的語言,可以產(chǎn)生各種不同的報表。也可以與HADOOP、PIG結(jié)合。
R語言是一個腳本語言,無須編譯,輸入后直接運行即可出結(jié)果。
內(nèi)置了非常強大的統(tǒng)計功能和輸出圖形功能,如JAVA在計算方面比較弱,輸出圖形也要和其他框架結(jié)合,這樣R語言就能實現(xiàn)一站式的功能,在R環(huán)境中就能實現(xiàn)。
!!!!!RHadoop培訓(xùn) 之 R基礎(chǔ)課
http://blog.fens.me/rhadoop-r-basic/
RHadoop實踐系列之二:RHadoop安裝與使用
http://blog.fens.me/rhadoop-rhadoop/R語言入門知識 一些常用操作和例子
http://www.biostatistic.net/thread-111-1-1.html
!!R語言畫圖大全,非常實用,需要文章畫圖的看過來了
一套S2SH的應(yīng)用,現(xiàn)用單線程,連續(xù)發(fā)1000個請求,用的DBCP鏈接池,結(jié)果報數(shù)據(jù)庫鏈接不夠用:
ERROR [org.hibernate.util.JDBCExceptionReporter] - Cannot get a connection, pool error Timeout waiting for idle object
在JAVA加上LOG:
log.info("active: " + dataSource.getNumActive() + " (max: "
+ dataSource.getMaxActive() + ") " + "idle: " + dataSource.getNumIdle()
+ "(max: " + dataSource.getMaxIdle() + ")");
結(jié)果顯示為:
active: 25 (max: 100) idle: 0(max: 30)
active的數(shù)量一直增加,但idle的數(shù)量一直為0。當(dāng)程序向鏈接池要鏈接的時候,如果池沒有,就會新建一個,active數(shù)就會加1,關(guān)閉鏈接后,鏈接會返回池,idle數(shù)加1。idle為0則表示池里沒有鏈接。
這樣說明鏈接一直在創(chuàng)建,沒有關(guān)閉放回池里。但鏈接是由SPRING和HIBERNATE管理的,代碼中沒有關(guān)閉鏈接的語句。之后試了N多配置,都還沒解決,如增加maxActive數(shù)等。最后,加上這一行,問題才終于解決:
<prop key="hibernate.connection.release_mode">after_transaction</prop>
這里默認(rèn)值是auto,如果是用JTA事務(wù)才適用,如果是JDBC事務(wù),就只能用after_transaction。
這樣每次事務(wù)結(jié)束后,就會關(guān)閉鏈接返回鏈接池。