private Map<String, LocalResource> buildResourceMapping() {
    ImmutableMap.Builder<String, LocalResource>  localResourceMapBuilder = ImmutableMap.builder();

    List<String> resourceNames = resourceConfig.getResourceNames();
    for (String resourceName : resourceNames) {
      String resourceLocalName = resourceConfig.getResourceLocalName(resourceName);
      LocalResourceType resourceType = resourceConfig.getResourceLocalType(resourceName);
      LocalResourceVisibility resourceVisibility = resourceConfig.getResourceLocalVisibility(resourceName);
      Path resourcePath = resourceConfig.getResourcePath(resourceName);

      LocalResource localResource = createLocalResource(resourcePath, resourceType, resourceVisibility);

      localResourceMapBuilder.put(resourceLocalName, localResource);
      log.info("preparing local resource: {}", resourceLocalName);
    }

    return localResourceMapBuilder.build();
  }
A universal approach to generate local resource map which can be put in ContainerLaunchContext directly
samza-yarn/src/main/java/org/apache/samza/job/yarn/LocalizerResourceMapper.java