public static void createFeatureGroups()

in Java/src/main/java/com/example/customername/FeatureGroupOperations.java [33:74]


    public static void createFeatureGroups(SageMakerClient sageMakerClient, String[] featureGroupNames,
        String featureGroupDescription, OnlineStoreConfig onlineStoreConfig, String eventTimeFeatureName,
        OfflineStoreConfig offlineStoreConfig, List < FeatureDefinition > columnDefinitions, String recordIdentifierFeatureName,
        String sagemakerRoleARN) {
        try {
            for (String featureGroupName: featureGroupNames) {

                CreateFeatureGroupRequest creationRequest = CreateFeatureGroupRequest.builder()
                    .featureGroupName(featureGroupName)
                    .description(featureGroupDescription)
                    .onlineStoreConfig(onlineStoreConfig)
                    .eventTimeFeatureName(eventTimeFeatureName)
                    .offlineStoreConfig(offlineStoreConfig)
                    .featureDefinitions(columnDefinitions)
                    .recordIdentifierFeatureName(recordIdentifierFeatureName)
                    .roleArn(sagemakerRoleARN)
                    .build();

                CreateFeatureGroupResponse response11 = sageMakerClient.createFeatureGroup(creationRequest);
                System.out.println(response11);
                System.out.println("featureGroupArn = " + response11.featureGroupArn());

                System.out.println(String.format("Creation for Feature group: %1$s submitted", featureGroupName));

            }

            for (String featureGroupName: featureGroupNames) {
                DescribeFeatureGroupRequest fg_describe_request = DescribeFeatureGroupRequest.builder()
                    .featureGroupName(featureGroupName)
                    .build();

                FeatureGroupStatus featureGroupCreationStatus;
                do {
                    featureGroupCreationStatus = sageMakerClient.describeFeatureGroup(fg_describe_request).featureGroupStatus();
                    System.out.print(".");
                } while (featureGroupCreationStatus != FeatureGroupStatus.CREATED);
                System.out.println(String.format("%1$s %2$s\r", featureGroupCreationStatus, featureGroupName));
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    };