Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.ssau.ru/files/education/metod_1/gavrilov_sozdanie_program.pdf
Дата изменения: Tue Dec 9 17:23:11 2014
Дата индексирования: Mon Apr 11 02:38:34 2016
Кодировка:
« .. ( )»

XDP GRID-
« XDP», « »


2010


004.75
..
. XDP, . XDP, - . , XDP, . XDP. « », « ». « ». 004.75

© .. , 2010 © , 2010


.................................................................................................. 4 1 XDP.......................................................... 5 1.1 .............................. 6 1.2 ...................................................... 6 1.3 ........................... 8 1.4 ....................................................... 8 1.5 .................................................................................... 10 1.6 - ......................................................................................... 11 1.7 - XDP ........ 14 1.8 - OSGi .............................. 15 1.9 .................................................. 18 1.10 . Slavery ..................................................... 22 2 ................. 24 2.1 Eclipse ............................................................. 24 2.2 XDP ..................... 26 2.3 ........................... 28 3 XDP ............................................... 34 3.1 ...................................... 34 3.2 - Solver ....................................... 39 3.3 - Director..................................... 42 3.4 Activator........................................................ 45 3.5 XDP .................................... 46 4 ..................... 50 .............................................. 52


, , , . , , . GRID, , , . «»: , , . XDP, . Java OSGi, XDP , . , , . XDP, , XDP. 4


1 XDP () [1] , , , , , . . : [2], - - , , . , , . , . ( , , (, Globus Toolkit)) . (Condor, X-Com) . , , , , . - , . , .

5


1.1 , , Erlang MPI. . , , , , , . , , Condor X-COM. (Application Programming Interface, API), , API. С Globus Toolkit. , , , , . , Globus. , . 1.2 , , .

6


1.1.

. 1.1, . (Master), (Slave) [3]. , . , , , , ­ . , . , , . , , , , .. , 7


, , . . 1.3 .1.1, . , , . . , API , , .. , , . 1.4 , [4,5]. . , , . . 1.2, 8


: .

1.2.

, , . , , , , , [4] , . , , , , . 9


, , , . , , , . , , , . . . , () ­ , . , , (, ) . 1.5 , ­ . : , .. . , , , , . 10


. 1.2, , . ­ (Solver), . , : (Distributor), (Combiner), (Director). , . , RGB HSL, HSL -, RGB. Director . , , , . . -, , . -, , . 1.6 - , ,

11


. , . : ; ( ) (, ); ; ; ; ; , ; , ; (, ) ; . , -- , [6]. - , . , , . , .. 12


. , « » ( ), , . , ( ), ( ).

1.3. -

. 1.3 , . . : , , API . : 13




, , , , , , , , , , , (, ). , , : , , , , , , , . ( ) , , , . , , . 1.7 - XDP . XDP (eXtensible Distributed Platform) . ( Connector) . Java 14


1.5, . 3 : Slavery, ; XDP, ; c- OSGi. . , XDP . 1.8 - OSGi XDP OSGi ­ Equinox Eclipse Foundation ­ , ­ Knoplerfish. Equinox , Java. OSGi (bundles), . OSGi - , , [7]. , OSGi, : , , .

15


. 1.4 OSGi Java.

1.4. OSGi

OSGi . 1. C (Execution Environment) ­ OSGi Java (J2SE, MIDP, CDC, CLDC ..). 2. C (Modules) ­ Java-. OSGi , Java, . , , , . . 3. (Life Cycle) ­ (bundles), , , , , 16


. , . , . 4. (Service Registry) ­ , . , . Java- . Java. . , . . 5. C (Security) ­ . Java Java2. . OSGi . , Equinox , . , , . , : ; 17




; . 1.9

, -- , , , . XDP (Storage) (Connector), (Metrics), (Events), (Replication), (SQL-) . , . , , : (load) -- ; (save) -- ; (delete) -- . , . , , . : UDP, TCP, HTTP(S), LRMP, TRAM, RPC. : . 18


\, , . , TCP/IP UDP. XDP , , : (asynh_load) -- , . , , , , , , (wait) . XDP , . , XDP, . (org.xdp.metrics) ­ , , . (org.slavery.metrics) ­ , . (org.xdp.eventmanager) ­ . 19








(org.slavery.sentinel) ­ , , , . XDP , . OSGi, XDP, , , . XDP , , , XDP. (org.xdp.starter) ­ . ( ) . : ( ), SQL Lite . . . . 20


, . . , , . . ­ . , ( ). ­ . , , ( ) xdp_storage. storage , GZIP Base64, storage_registry URL , , . XDP : xdp_storage ­ , . , . xdp_other ­ , , , . : , , , . , ­ . .

21


1.10 . Slavery , . , , , OSGi. , OSGi , , , , , , . : ; , ; , apache.common; , ; , , . : (Executor) ­ , , , 22


; (Sentinel) ­ . , . , , . . . . OSGi . , : , . XDP , .

23


2 XDP OSGi, (IDE) Eclipse (. . 2.1). (NetBeans, IDEA ..), .

2.1. Eclipse



: Eclipse; XDP . 2.1 Eclipse

http://www.eclipse.org/downloads/.

24


Eclipse for RCP and RAP developers. . .. « » (workspace), . . 2.2. , Eclipse , . . , , .

2.2.

. , Use this as the default and do not ask again. , (Go to the workbench), (. . 2.3). . ­ . ­ (, , , ). 25


, .

2.3. Eclipse

2.2 XDP XDP . . : Plugins, jar-, OSGi, jar- XDP; ; 26




. , hosts.conf. , XDP. ( , , XDP ..), . :
:

­ IP- , ­ , . , ( ). , . 2.1.
2.1. hosts.conf Ivanov:15000 Petrov:15000 Fileserver:4000 192.168.0.10:2001 192.168.0.11:20002

GRID . , , 2.2.
2.2. hosts.conf localhost:15000

27


localhost:15001 localhost:15002

2.3 Eclipse , , .. (Target Platform), .. , . Window/Preferences, Plug-in Development/Target Platform (. . 2.4.)

2.4.

XDP Add, (. . 2.5). 28


Nothing: Start with an empty target definition, Next .

2.5.

Name (. 2.6).

2.6.

. Locations Add.

29


(. . 2.7), Directory, Next.

2.7.

, , , C:\XDP (. . 2.8). Finish, Next .

2.8.

, . Environment . . 2.9 Windows (32- ). . 30


Java (JRE), , JRE.

2.9.

Finish, . , , . (. . 2.10). . ( Window/Preferences) General/Workspace, Text file encoding Other:, UTF-8 (. . 2.11). Eclipse, XDP. 31


XDP.

2.10.

32


2.11.

33


3 XDP XDP (bundles) OSGi, . jar-, : manifest.mf, ; , ; Activator.java, Activator, OSGi . Eclipse Plug-in, . 3.1 Eclipse File/New/Project, (. . 3.1). Plug-in development/Plug-in Project, Next. (. . 3.2) ( Project name:). (Target Platform) an OSGi framework, OSGi Equinox. Next, (. . 3.3). , , . 34


Next.

3.1.

3.2.

. Hello OSGi Bundle (. . 3.4). 35


Next . Finish .

3.3.

3.4.

Eclipse (. . 3.5). Package Explorer , , , . , 36


/ , . manifest.mf.

3.5. manifest.mf

XDP . Plug-in Content Dependencies Dependencies . ( Required Plug-ins, ) ( Imported Packages, org.osgi.framework), . . 3.6. 37


( ) Dependency Analysis Automated Management of Dependencies, .

3.6.

, org.osgi.framework, : org.eclipse.ecf.remoteservice.eventadmin org.osgi.service.event org.slavery.basic org.xdp.commons org.xdp.commons.interfaces

org.slf4j , Imported Packages Add, (. . 3.7). 38


Exported Packages: . , , ( , , ).

3.7.

manifest.mf, . 3.2 - Solver XDP, , , Solver. , - , . . ( ) New/Class. (. . 3.8). ( 39


­ SampleSolver), . Browse, Superclass:. , . org.slavery.basic.Solver.

3.8. - Solver

Finish , . . , .. , Solver . , Eclipse. SampleSolver, 40


Add constructor. . , , perform() . : ; ; . 3.1 , .
3.1. - Solver, package sample; import org.slavery.basic.Solver; import org.xdp.commons.SessionID; import org.xdp.commons.URI; public class SampleSolver extends Solver { public SampleSolver(SessionID sid, String name) { super(sid, name); } @Override public void perform() { double d = (Double) storage.load( new URI(getName() + "/initdata"), getSessionID()); double r = Math.sin(d); storage.save(new URI(getName() + "/resdata"), r, getSessionID()); }

41


}

load() storage, Solver. , save(). , , . , org.xdp.commons.URI, Solver getName(), , getSessionID(), . , . , , , , -. . 3.3 - Director Director. XDP , , . 3.2 Director, Solver 3.1.

42


3.2. - Director, package sample; import import import import import import java.util.List; java.util.ListIterator; org.slavery.basic.Director; org.xdp.commons.PlatformURL; org.xdp.commons.SessionID; org.xdp.commons.URI;

public class SampleDirector extends Director { public SampleDirector(SessionID sid, String name) { super(sid, name); } @Override public void perform() { List executorList = (List) storage.load( new URI(getName() + "/solverList"), getSessionID()); int count = executorList.size(); double max = Math.PI; double current = 0; ListIterator iter = executorList.listIterator(); for (int i = 0; i< count; i++) { current = max / count * i; storage.save( new URI("solver" + i + "/initdata"), current, getSessionID()); starter.startExecutor(iter.next(), new SampleSolver(getSessionID(), "solver" + i)); } for (int i = 0; i< count; i++) {

43


current = (Double)storage.load( new URI("solver" + i + "/resdata"), getSessionID()); System.out.println(current); } } }

, - Director perform(). . , Solver, storage getSessionID(), . . 0 PI, . save storage. . startExecutor() starter, , ( SampleSolver) . load() storage, . , , , 44


. 3.4 Activator OSGi org.osgi.framework.BundleActivator. start() stop(), , , . OSGi , , . , , XDP. start() :
<->.registerTask("", <->.class)

XDP org.slavery.basic.Director registerTask() . 3.3 - 3.2.
3.3. - package sample; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; public class Activator implements BundleActivator { public void start(BundleContext context)

45


throws Exception { System.out.println("Hello World!!"); SampleDirector.registerTask("Sample", SampleDirector.class); }

public void stop(BundleContext context) throws Exception { System.out.println("Goodbye World!!"); } }

- XDP . 3.5 XDP Eclipse , . Run/Run Configurations..., OSGi Framework ( , +). (. . 3.9).

46


3.9.

( , ), Name:. , ( Start Level ) : org.xdp.storage 5; org.xdp.starter 5; org.xdp.facade 6. (x)= Arguments VM Arguments: :
-Dorg.xdp.connector.communication.port=NNNN

NNNN ­ , hosts.conf . , 47


, XDP. . 3.10. Apply . . Run ( Run/Run ). , Eclipse (. . 3.11).

3.10. , Java

48


3.11.

49


4 , , , . XDP. 1. . , , . 2. XDP. , , . , . 3. Java. , Java. , , , , . , , . 4. . . ( Solver), - Director, 50


, .. . 5. XDP. -, , 4 . , 3. 6. . , . , 4 , 5, . , . 7. . , GRID- . . . 8. . : ; ; ( UML); XDP; ; ( ). 51


1. , .. [] / .. . ­ .: . .. , 2005. ­ 410 c. 2. Soblewski, M. Sorcer: Computing and Metacomputing Intergrid [] / Soblewski, Michael // Texas Tech University. ­ 2007. ­ P. 74­ 85. 3. , .. [] / .. // . ­ 2006. ­ 1. ­ . 68-75. 4. , . [] / . , . . ­ .: , 1999. ­ 512 c. 5. , . [] / . . ­ .: , 1991. ­ 342 c. 6. , .. - : GRID / .. , .. , .. . ­ , 2005. ­ 32 . 7. OSGi [ ]. ­ : http://www.osgi.org/Specifications/ 8. , .. - OSGI [] / .. , .. , .. // - . ­ 2008. ­ . 54. ­ . 113-119

52