项目作者: ramidahmouni

项目描述 :
jar importable library partitioning
高级语言: Java
项目地址: git://github.com/ramidahmouni/test-adneom-18.git
创建时间: 2018-06-24T20:25:50Z
项目社区:https://github.com/ramidahmouni/test-adneom-18

开源协议:

下载


Partitioner interface caller

Architecture

  1. com.adneom.partitioner
  2. |
  3. |
  4. /* application implementation layer */
  5. |
  6. |
  7. |___application.partitioner Partitioner Interface to autowired
  8. |
  9. |___application.partitioner.impl PartitionImpl Class implements Partitioner
  10. |
  11. |___application.partitioner.utils PartiionsUtils Interface to autowired
  12. |
  13. |___application.partitioner.utils.impl PartitionsUtilsImpl implements PartitionsUtils
  14. /* domain Object layer */
  15. |
  16. |___domain.partitions Partitions Object contain a list Partition Object
  17. |
  18. |___domain.partitions.partition Partition Object contain a list of partitioned list
  19. /* demo application */
  20. /* the .gitignore hasn't been added to permete the upload of the partitioner-demo-v.1.0.jar for testing the implementation */
  21. |___demo implementation 'App Class' (Java Application deployment AccessPoint) by partitioning method from the Launcher Class
  22. |___demo.partitioner Launcher Class and some utilities for input buffer

Deployment

This is spring boot application deployment mode.

  1. - The Class com.adneom.partitioner.demo.App
  2. allows you to deploy a demonstration application to test the implementation work as a Java Application
  3. from the eclipse console or by calling the partitioner-demo-1.0.jar.
  4. by the windows command line "java -jar partition-demo-1.0.jar"
  5. - The Class com.adneom.partitioner.Application allows you to deploy the interface implementations into spring boot environment
  6. and permet to @autowired the interface implementation from your project.

Documentation

The Partitioner interface

  1. This Interface offers two methods call
  2. com.adneom.partitioner.application.Partitioner.partition(List<String> strList, Integer partitionMaxSize);
  3. The first one will partition a list of String Object and return it, attributing maximum value per partition as parameters.
  4. It will return a partitioned list of the strList parameter
  5. com.adneom.partitioner.application.Partitioner.partition(Map<Integer partitionMaxSize, List<String> strList>);
  6. The second one will partition a map of list Partition Object always depending of
  7. the maximum value per partition as a key and the String list to partition
  8. in the map parameters
  9. It will return a list of Partitions Object of partitioned strList Map

The PartitionsUtils interface

  1. This Interface offers a method checker
  2. com.adneom.partitioner.application.utils.PartitionsUtils.checkPartitionsSize(List<String> strList, Integer partitionSize);
  3. This method takes a String list and a Integer as parameters and checks if the partitioning requested is coherent
  4. It will return FALSE if it's not coherent and TRUE if it is.

Build install

  1. Update your dependencies (Maven -> Update Project)
  2. Maven clean install
  3. Maven build install
  4. Run Junit tests

Code

  1. To get started you will need Maven Project
  2. Install dependencies needed
  3. Adding the partitioner-SNAPSHOT-V.1.0.0.jar generated after building the project as an External Jar in the Referencies Library
  4. Using Partitions Object as Object response of the method Unit partitioning
  5. Using a list of Partitions Objects in case you need to partition a Map of String values and its partition maximum size
  6. Use @Autowired springbootframework to surcharge the interfaces
  7. Call the implementation using interface surcharged into your implementations
  8. Delopying spring boot framework

References:

  1. https://spring.io/projects/spring-boot
  2. https://mvnrepository.com/

rami.dahmouni@unknowns.domain