Spring Questions and Answers – Parallelizing Processing and Load Balancing

This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Parallelizing Processing and Load Balancing”.

1. To quickly grid-enable a method on a bean using GridGain.
a) @Gridify
b) @Grid
c) @GridGain
d) None of the mentioned
View Answer

Answer: a
Explanation: You can use GridGain @Gridify annotation along with some Spring AOP configuration to let GridGain know that it can parallelize the execution of the method across the grid.

2. GridGain provides:-
a) load balancing
b) fault tolerance
c) routing
d) all of the mentioned
View Answer

Answer: d
Explanation: GridGain provides load balancing as well as fault tolerance and routing out of the box, which you get for free by adding this annotation.

3. To build a parallelized solution for a problem that’s intrinsically better-suited to parallelization or that, for want of resources, needs to be chunked.
a) map
b) reduce
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: c
Explanation: Use map/reduce to approach the problem concurrently.
advertisement
advertisement

4. GridGain works with a GridTask, which specifies how to handle the main unit of work of the interface type:-
a) Grid
b) GridGain
c) GridJob
d) All of the mentioned
View Answer

Answer: c
Explanation: Underneath the hood, GridGain works with a GridTask, which specifies how to handle the main unit of work of the interface type GridJob.

5. When you call the method on the service with the @Gridify annotation pointing to this GridTask implementation, it stops execution of method and loads an instance of this implementation.
a) True
b) False
View Answer

Answer: a
Explanation: The parameters, as passed to the method with the annotation, are passed to: split(int i, final GridifyArgument gridifyArgument), which is used to dole out GridJob instances.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. When using GridGain stem mostly from the fact that what you develop on one node can’t always automatically work on another node with no additional configuration.
a) True
b) False
View Answer

Answer: a
Explanation: The parameters, as passed to the method with the annotation, are passed to: split(int i, final GridifyArgument gridifyArgument), which is used to dole out GridJob instances.

7. GridGain lets you start up nodes using the startup script in the:-
a) etc
b) opt
c) bin
d) all of the mentioned
View Answer

Answer: c
Explanation: GridGain lets you start up nodes using the startup script in the bin directory of the distribution.
advertisement

8. To hoist a grid node into existence.
a) GridLoader
b) GridLoad
c) Grid
d) GridGain
View Answer

Answer: a
Explanation: The GridLoader’s job is to hoist a grid node into existence.

9. When you use the script that comes with the distribution is the class:-
a) GridCommandLine
b) GridCommandLineLoader
c) GridCommand
d) All of the mentioned
View Answer

Answer: b
Explanation: The one that gets started when you use the script that comes with the distribution is the class GridCommandLineLoader.

advertisement

10. A GridLoader instance is responsible for many things such as:-
a) GridFactory.start
b) GridFactory.stop
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: A GridLoader instance is responsible for many things, not the least of which is correctly calling GridFactory.start and GridFactory.stop.

11. GridFactory.start can take as its first parameter a:-
a) GridConfiguration object
b) Spring application context
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: This GridConfiguration object is what tells GridGain what is unique about a given node and the grid’s topology. By default, it uses $GRIDGAIN HOME/config/default-spring.xml, which, in turn, does things such as load a Grid object and configure user parameters about a specific node.

12. The file which enables you to tell GridGain about which GridTask classes are deployed:-
a) gridgain.xml
b) gridgain.html
c) grid.xml
d) gridify.xml
View Answer

Answer: a
Explanation: gridgain.xml file, which is optional, enables you to tell GridGain about which GridTask classes are deployed.

13. Instances of the ApplicationContext can be injected into the various GridGain class instances (GridTask, GridJob, and so forth) using GridGain:-
a) @Grid
b) @GridGain
c) @Gridify
d) None of the mentioned
View Answer

Answer: d
Explanation: Instances of the ApplicationContext can be injected into the various GridGain class instances (GridTask, GridJob, and so forth) using GridGain @GridSpringApplicationContextResource annotation.

14. This is the default implementation. It is used when you run gridgain.sh or gridgain.bat.
a) org.gridgain.grid.loaders.cmdline.GridCommandLineLoader
b) org.gridgain.grid.loaders.servlet.GridServletLoader
c) org.gridgain.grid.loaders.jboss.GridJbossLoader
d) org.gridgain.grid.loaders.weblogic.GridWeblogicStartup
View Answer

Answer: a
Explanation: org.gridgain.grid.loaders.cmdline.GridCommandLineLoader This is the default implementation. It is used when you run gridgain.sh or gridgain.bat.

15. This is likely the second most useful implementation. It provides a servlet that bootstraps the GridGain instance inside any web container as a servlet.
a) org.gridgain.grid.loaders.cmdline.GridCommandLineLoader
b) org.gridgain.grid.loaders.servlet.GridServletLoader
c) org.gridgain.grid.loaders.jboss.GridJbossLoader
d) org.gridgain.grid.loaders.weblogic.GridWeblogicStartup
View Answer

Answer: b
Explanation: org.gridgain.grid.loaders.servlet.GridServletLoader This is likely the second most useful implementation. It provides a servlet that bootstraps the GridGain instance inside any web container as a servlet.

Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.