Search in sources :

Example 1 with NTRelationship

use of org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTRelationship in project neo4j by neo4j.

the class BuiltInProceduresTest method setup.

@BeforeEach
void setup() throws Exception {
    procs.registerComponent(KernelTransaction.class, ctx -> ctx.internalTransaction().kernelTransaction(), false);
    procs.registerComponent(DependencyResolver.class, Context::dependencyResolver, false);
    procs.registerComponent(GraphDatabaseAPI.class, Context::graphDatabaseAPI, false);
    procs.registerComponent(Transaction.class, Context::internalTransaction, true);
    procs.registerComponent(SecurityContext.class, Context::securityContext, true);
    procs.registerComponent(ProcedureCallContext.class, Context::procedureCallContext, true);
    procs.registerComponent(SystemGraphComponents.class, ctx -> systemGraphComponents, false);
    procs.registerComponent(Log.class, ctx -> log, false);
    procs.registerType(Node.class, NTNode);
    procs.registerType(Relationship.class, NTRelationship);
    procs.registerType(Path.class, NTPath);
    new SpecialBuiltInProcedures("1.3.37", Edition.COMMUNITY.toString()).accept(procs);
    procs.registerProcedure(BuiltInProcedures.class);
    procs.registerProcedure(BuiltInDbmsProcedures.class);
    when(transaction.kernelTransaction()).thenReturn(tx);
    when(tx.tokenRead()).thenReturn(tokens);
    when(tx.dataRead()).thenReturn(read);
    when(tx.schemaRead()).thenReturn(schemaRead);
    when(tx.securityContext()).thenReturn(SecurityContext.AUTH_DISABLED);
    when(callContext.isCalledFromCypher()).thenReturn(false);
    when(schemaRead.snapshot()).thenReturn(schemaReadCore);
    when(tokens.propertyKeyGetAllTokens()).thenAnswer(asTokens(propKeys));
    when(tokens.labelsGetAllTokens()).thenAnswer(asTokens(labels));
    when(tokens.relationshipTypesGetAllTokens()).thenAnswer(asTokens(relTypes));
    when(schemaReadCore.indexesGetAll()).thenAnswer(i -> Iterators.concat(indexes.iterator(), uniqueIndexes.iterator()));
    when(schemaReadCore.index(any(SchemaDescriptor.class))).thenAnswer((Answer<IndexDescriptor>) invocationOnMock -> {
        SchemaDescriptor schema = invocationOnMock.getArgument(0);
        return getIndexReference(schema);
    });
    when(schemaReadCore.constraintsGetAll()).thenAnswer(i -> constraints.iterator());
    when(tokens.propertyKeyName(anyInt())).thenAnswer(invocation -> propKeys.get(invocation.getArgument(0)));
    when(tokens.nodeLabelName(anyInt())).thenAnswer(invocation -> labels.get(invocation.getArgument(0)));
    when(tokens.relationshipTypeName(anyInt())).thenAnswer(invocation -> relTypes.get(invocation.getArgument(0)));
    when(tokens.propertyKeyGetName(anyInt())).thenAnswer(invocation -> propKeys.get(invocation.getArgument(0)));
    when(tokens.labelGetName(anyInt())).thenAnswer(invocation -> labels.get(invocation.getArgument(0)));
    when(tokens.relationshipTypeGetName(anyInt())).thenAnswer(invocation -> relTypes.get(invocation.getArgument(0)));
    when(tokens.entityTokensGetNames(any(), any())).then(invocation -> {
        EntityType type = invocation.getArgument(0);
        int[] ids = invocation.getArgument(1);
        Map<Integer, String> mapping = type == EntityType.NODE ? labels : relTypes;
        return Arrays.stream(ids).mapToObj(mapping::get).toArray(String[]::new);
    });
    when(schemaReadCore.constraintsGetForRelationshipType(anyInt())).thenReturn(emptyIterator());
    when(schemaReadCore.indexesGetForLabel(anyInt())).thenReturn(emptyIterator());
    when(schemaReadCore.indexesGetForRelationshipType(anyInt())).thenReturn(emptyIterator());
    when(schemaReadCore.constraintsGetForLabel(anyInt())).thenReturn(emptyIterator());
    when(read.countsForNode(anyInt())).thenReturn(1L);
    when(read.countsForRelationship(anyInt(), anyInt(), anyInt())).thenReturn(1L);
    when(schemaReadCore.indexGetState(any(IndexDescriptor.class))).thenReturn(InternalIndexState.ONLINE);
}
Also used : SecurityContext(org.neo4j.internal.kernel.api.security.SecurityContext) BasicContext.buildContext(org.neo4j.kernel.api.procedure.BasicContext.buildContext) Context(org.neo4j.kernel.api.procedure.Context) ProcedureCallContext(org.neo4j.internal.kernel.api.procs.ProcedureCallContext) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) SystemGraphComponent(org.neo4j.dbms.database.SystemGraphComponent) MapUtil(org.neo4j.internal.helpers.collection.MapUtil) Log(org.neo4j.logging.Log) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) EMPTY(org.neo4j.kernel.api.index.IndexProvider.EMPTY) Config(org.neo4j.configuration.Config) ProcedureException(org.neo4j.internal.kernel.api.exceptions.ProcedureException) Value(org.neo4j.values.storable.Value) ConstraintDescriptor(org.neo4j.internal.schema.ConstraintDescriptor) Statement(org.neo4j.kernel.api.Statement) InternalTransaction(org.neo4j.kernel.impl.coreapi.InternalTransaction) Collections.singletonList(java.util.Collections.singletonList) SchemaRead(org.neo4j.internal.kernel.api.SchemaRead) EMPTY_RESOURCE_TRACKER(org.neo4j.kernel.api.ResourceTracker.EMPTY_RESOURCE_TRACKER) SchemaReadCore(org.neo4j.internal.kernel.api.SchemaReadCore) IndexNotFoundKernelException(org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException) Map(java.util.Map) SecurityContext(org.neo4j.internal.kernel.api.security.SecurityContext) Transaction(org.neo4j.graphdb.Transaction) NodeKeyConstraintDescriptor(org.neo4j.internal.schema.constraints.NodeKeyConstraintDescriptor) PopulationProgress(org.neo4j.internal.kernel.api.PopulationProgress) SettingValueParsers(org.neo4j.configuration.SettingValueParsers) TextValue(org.neo4j.values.storable.TextValue) Collections.emptyIterator(java.util.Collections.emptyIterator) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Test(org.junit.jupiter.api.Test) Path(org.neo4j.graphdb.Path) List(java.util.List) SchemaDescriptor(org.neo4j.internal.schema.SchemaDescriptor) EntityType(org.neo4j.common.EntityType) IndexPrototype(org.neo4j.internal.schema.IndexPrototype) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) Mockito.mock(org.mockito.Mockito.mock) IndexingService(org.neo4j.kernel.impl.api.index.IndexingService) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AnyValue(org.neo4j.values.AnyValue) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) NodeExistenceConstraintDescriptor(org.neo4j.internal.schema.constraints.NodeExistenceConstraintDescriptor) SettingImpl(org.neo4j.configuration.SettingImpl) InternalIndexState(org.neo4j.internal.kernel.api.InternalIndexState) UniquenessConstraintDescriptor(org.neo4j.internal.schema.constraints.UniquenessConstraintDescriptor) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) TokenRead(org.neo4j.internal.kernel.api.TokenRead) HashMap(java.util.HashMap) NTNode(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTNode) Node(org.neo4j.graphdb.Node) ConstraintDescriptorFactory(org.neo4j.internal.schema.constraints.ConstraintDescriptorFactory) ArrayList(java.util.ArrayList) GlobalProcedures(org.neo4j.kernel.api.procedure.GlobalProcedures) Values(org.neo4j.values.storable.Values) DefaultValueMapper(org.neo4j.kernel.impl.util.DefaultValueMapper) Answer(org.mockito.stubbing.Answer) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) SchemaDescriptor.forLabel(org.neo4j.internal.schema.SchemaDescriptor.forLabel) SystemGraphComponents(org.neo4j.dbms.database.SystemGraphComponents) TestSystemGraphComponent(org.neo4j.dbms.database.TestSystemGraphComponent) DependencyResolver(org.neo4j.common.DependencyResolver) IndexConfig(org.neo4j.internal.schema.IndexConfig) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) IntSupplier(java.util.function.IntSupplier) ValueUtils(org.neo4j.kernel.impl.util.ValueUtils) Iterator(java.util.Iterator) Read(org.neo4j.internal.kernel.api.Read) Iterators(org.neo4j.internal.helpers.collection.Iterators) Edition(org.neo4j.common.Edition) Setting(org.neo4j.graphdb.config.Setting) BasicContext.buildContext(org.neo4j.kernel.api.procedure.BasicContext.buildContext) LabelSchemaDescriptor(org.neo4j.internal.schema.LabelSchemaDescriptor) Mockito.when(org.mockito.Mockito.when) Context(org.neo4j.kernel.api.procedure.Context) NTPath(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTPath) GlobalProceduresRegistry(org.neo4j.procedure.impl.GlobalProceduresRegistry) ProcedureCallContext(org.neo4j.internal.kernel.api.procs.ProcedureCallContext) Relationship(org.neo4j.graphdb.Relationship) NTRelationship(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTRelationship) KernelTransaction(org.neo4j.kernel.api.KernelTransaction) NamedToken(org.neo4j.token.api.NamedToken) ProcedureSignature(org.neo4j.internal.kernel.api.procs.ProcedureSignature) EntityType(org.neo4j.common.EntityType) SchemaDescriptor(org.neo4j.internal.schema.SchemaDescriptor) LabelSchemaDescriptor(org.neo4j.internal.schema.LabelSchemaDescriptor) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with NTRelationship

use of org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTRelationship in project neo4j by neo4j.

the class DatabaseManagementServiceFactory method setupProcedures.

/**
 * Creates and registers the systems procedures, including those which belong to a particular edition.
 * N.B. This method takes a {@link DatabaseManager} as an unused parameter *intentionally*, in
 * order to enforce that the databaseManager must be constructed first.
 */
@SuppressWarnings("unused")
private static void setupProcedures(GlobalModule globalModule, AbstractEditionModule editionModule, DatabaseManager<?> databaseManager) {
    Supplier<GlobalProcedures> procedureInitializer = () -> {
        Config globalConfig = globalModule.getGlobalConfig();
        Path proceduresDirectory = globalConfig.get(GraphDatabaseSettings.plugin_dir);
        LogService logService = globalModule.getLogService();
        Log internalLog = logService.getInternalLog(GlobalProcedures.class);
        Log proceduresLog = logService.getUserLog(GlobalProcedures.class);
        ProcedureConfig procedureConfig = new ProcedureConfig(globalConfig);
        Edition neo4jEdition = globalModule.getDbmsInfo().edition;
        SpecialBuiltInProcedures builtInProcedures = new SpecialBuiltInProcedures(Version.getNeo4jVersion(), neo4jEdition.toString());
        GlobalProceduresRegistry globalProcedures = new GlobalProceduresRegistry(builtInProcedures, proceduresDirectory, internalLog, procedureConfig);
        globalProcedures.registerType(Node.class, NTNode);
        globalProcedures.registerType(NodeValue.class, NTNode);
        globalProcedures.registerType(Relationship.class, NTRelationship);
        globalProcedures.registerType(RelationshipValue.class, NTRelationship);
        globalProcedures.registerType(org.neo4j.graphdb.Path.class, NTPath);
        globalProcedures.registerType(PathValue.class, NTPath);
        globalProcedures.registerType(Geometry.class, NTGeometry);
        globalProcedures.registerType(Point.class, NTPoint);
        globalProcedures.registerType(PointValue.class, NTPoint);
        // Below components are not public API, but are made available for internal
        // procedures to call, and to provide temporary workarounds for the following
        // patterns:
        // - Batch-transaction imports (GDAPI, needs to be real and passed to background processing threads)
        // - Group-transaction writes (same pattern as above, but rather than splitting large transactions,
        // combine lots of small ones)
        // - Bleeding-edge performance (KernelTransaction, to bypass overhead of working with Core API)
        globalProcedures.registerComponent(DependencyResolver.class, Context::dependencyResolver, false);
        globalProcedures.registerComponent(KernelTransaction.class, ctx -> ctx.internalTransaction().kernelTransaction(), false);
        globalProcedures.registerComponent(GraphDatabaseAPI.class, Context::graphDatabaseAPI, false);
        globalProcedures.registerComponent(SystemGraphComponents.class, ctx -> globalModule.getSystemGraphComponents(), false);
        globalProcedures.registerComponent(ValueMapper.class, Context::valueMapper, true);
        // Register injected public API components
        globalProcedures.registerComponent(Log.class, ctx -> proceduresLog, true);
        globalProcedures.registerComponent(Transaction.class, new ProcedureTransactionProvider(), true);
        globalProcedures.registerComponent(org.neo4j.procedure.TerminationGuard.class, new TerminationGuardProvider(), true);
        globalProcedures.registerComponent(SecurityContext.class, Context::securityContext, true);
        globalProcedures.registerComponent(ProcedureCallContext.class, Context::procedureCallContext, true);
        globalProcedures.registerComponent(FulltextAdapter.class, ctx -> ctx.dependencyResolver().resolveDependency(FulltextAdapter.class), true);
        globalProcedures.registerComponent(GraphDatabaseService.class, ctx -> new GraphDatabaseFacade((GraphDatabaseFacade) ctx.graphDatabaseAPI(), new ProcedureLoginContextTransformer(ctx)), true);
        globalProcedures.registerComponent(DataCollector.class, ctx -> ctx.dependencyResolver().resolveDependency(DataCollector.class), false);
        // Edition procedures
        try {
            editionModule.registerProcedures(globalProcedures, procedureConfig, globalModule, databaseManager);
        } catch (KernelException e) {
            internalLog.error("Failed to register built-in edition procedures at start up: " + e.getMessage());
        }
        globalModule.getGlobalLife().add(globalProcedures);
        return globalProcedures;
    };
    GlobalProcedures procedures = tryResolveOrCreate(GlobalProcedures.class, globalModule.getExternalDependencyResolver(), procedureInitializer);
    if (procedures instanceof Consumer) {
        ((Consumer) procedures).accept(procedureInitializer);
    }
    globalModule.getGlobalDependencies().satisfyDependency(procedures);
}
Also used : Log(org.neo4j.logging.Log) NodeValue(org.neo4j.values.virtual.NodeValue) Config(org.neo4j.configuration.Config) LifeSupport(org.neo4j.kernel.lifecycle.LifeSupport) DisabledNeoWebServer(org.neo4j.server.web.DisabledNeoWebServer) HttpConnector(org.neo4j.configuration.connectors.HttpConnector) SpecialBuiltInProcedures(org.neo4j.procedure.builtin.SpecialBuiltInProcedures) SecurityContext(org.neo4j.internal.kernel.api.security.SecurityContext) HttpsConnector(org.neo4j.configuration.connectors.HttpsConnector) ProcedureTransactionProvider(org.neo4j.procedure.impl.ProcedureTransactionProvider) Transaction(org.neo4j.graphdb.Transaction) Path(java.nio.file.Path) DatabaseIdRepository(org.neo4j.kernel.database.DatabaseIdRepository) NAMED_SYSTEM_DATABASE_ID(org.neo4j.kernel.database.DatabaseIdRepository.NAMED_SYSTEM_DATABASE_ID) ProcedureConfig(org.neo4j.procedure.impl.ProcedureConfig) RelationshipValue(org.neo4j.values.virtual.RelationshipValue) Dependencies(org.neo4j.collection.Dependencies) Geometry(org.neo4j.graphdb.spatial.Geometry) PointValue(org.neo4j.values.storable.PointValue) DatabaseContext(org.neo4j.dbms.database.DatabaseContext) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) DatabaseStateService(org.neo4j.dbms.DatabaseStateService) Optional(java.util.Optional) PathValue(org.neo4j.values.virtual.PathValue) BoltServer(org.neo4j.bolt.BoltServer) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) DatabaseManager(org.neo4j.dbms.database.DatabaseManager) ValueMapper(org.neo4j.values.ValueMapper) GraphDatabaseSettings(org.neo4j.configuration.GraphDatabaseSettings) ServerSettings(org.neo4j.server.configuration.ServerSettings) LogProvider(org.neo4j.logging.LogProvider) DbmsRuntimeSystemGraphComponent(org.neo4j.dbms.database.DbmsRuntimeSystemGraphComponent) ProcedureLoginContextTransformer(org.neo4j.procedure.impl.ProcedureLoginContextTransformer) NTNode(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTNode) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Node(org.neo4j.graphdb.Node) SYSTEM_DATABASE_NAME(org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME) GlobalProcedures(org.neo4j.kernel.api.procedure.GlobalProcedures) DefaultDatabaseInitializer(org.neo4j.dbms.database.DefaultDatabaseInitializer) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) BoltGraphDatabaseManagementServiceSPI(org.neo4j.bolt.dbapi.BoltGraphDatabaseManagementServiceSPI) SystemGraphComponents(org.neo4j.dbms.database.SystemGraphComponents) Point(org.neo4j.graphdb.spatial.Point) DbmsInfo(org.neo4j.kernel.impl.factory.DbmsInfo) DataCollector(org.neo4j.internal.collector.DataCollector) DependencyResolver(org.neo4j.common.DependencyResolver) Lifecycle(org.neo4j.kernel.lifecycle.Lifecycle) NTGeometry(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTGeometry) SecurityProvider(org.neo4j.kernel.api.security.provider.SecurityProvider) TerminationGuardProvider(org.neo4j.procedure.impl.TerminationGuardProvider) Edition(org.neo4j.common.Edition) Version(org.neo4j.kernel.internal.Version) NTPoint(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTPoint) DatabaseManagementServiceImpl(org.neo4j.dbms.database.DatabaseManagementServiceImpl) FulltextAdapter(org.neo4j.kernel.api.impl.fulltext.FulltextAdapter) Context(org.neo4j.kernel.api.procedure.Context) AbstractEditionModule(org.neo4j.graphdb.factory.module.edition.AbstractEditionModule) NTPath(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTPath) Consumer(java.util.function.Consumer) LogService(org.neo4j.logging.internal.LogService) GlobalProceduresRegistry(org.neo4j.procedure.impl.GlobalProceduresRegistry) ProcedureCallContext(org.neo4j.internal.kernel.api.procs.ProcedureCallContext) Relationship(org.neo4j.graphdb.Relationship) KernelException(org.neo4j.exceptions.KernelException) CommunityEditionModule.tryResolveOrCreate(org.neo4j.graphdb.factory.module.edition.CommunityEditionModule.tryResolveOrCreate) NTRelationship(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTRelationship) UnableToStartDatabaseException(org.neo4j.dbms.database.UnableToStartDatabaseException) KernelTransaction(org.neo4j.kernel.api.KernelTransaction) GraphDatabaseFacade(org.neo4j.kernel.impl.factory.GraphDatabaseFacade) GlobalModule(org.neo4j.graphdb.factory.module.GlobalModule) NodeValue(org.neo4j.values.virtual.NodeValue) KernelTransaction(org.neo4j.kernel.api.KernelTransaction) ProcedureLoginContextTransformer(org.neo4j.procedure.impl.ProcedureLoginContextTransformer) ValueMapper(org.neo4j.values.ValueMapper) PathValue(org.neo4j.values.virtual.PathValue) Config(org.neo4j.configuration.Config) ProcedureConfig(org.neo4j.procedure.impl.ProcedureConfig) NTNode(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTNode) Node(org.neo4j.graphdb.Node) RelationshipValue(org.neo4j.values.virtual.RelationshipValue) TerminationGuardProvider(org.neo4j.procedure.impl.TerminationGuardProvider) SystemGraphComponents(org.neo4j.dbms.database.SystemGraphComponents) ProcedureCallContext(org.neo4j.internal.kernel.api.procs.ProcedureCallContext) GlobalProceduresRegistry(org.neo4j.procedure.impl.GlobalProceduresRegistry) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Consumer(java.util.function.Consumer) ProcedureTransactionProvider(org.neo4j.procedure.impl.ProcedureTransactionProvider) KernelException(org.neo4j.exceptions.KernelException) ProcedureConfig(org.neo4j.procedure.impl.ProcedureConfig) SpecialBuiltInProcedures(org.neo4j.procedure.builtin.SpecialBuiltInProcedures) Path(java.nio.file.Path) NTPath(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTPath) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) FulltextAdapter(org.neo4j.kernel.api.impl.fulltext.FulltextAdapter) Log(org.neo4j.logging.Log) PointValue(org.neo4j.values.storable.PointValue) Point(org.neo4j.graphdb.spatial.Point) NTPoint(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTPoint) DataCollector(org.neo4j.internal.collector.DataCollector) GlobalProcedures(org.neo4j.kernel.api.procedure.GlobalProcedures) Edition(org.neo4j.common.Edition) DependencyResolver(org.neo4j.common.DependencyResolver) Geometry(org.neo4j.graphdb.spatial.Geometry) NTGeometry(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTGeometry) Transaction(org.neo4j.graphdb.Transaction) KernelTransaction(org.neo4j.kernel.api.KernelTransaction) Relationship(org.neo4j.graphdb.Relationship) NTRelationship(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTRelationship) SecurityContext(org.neo4j.internal.kernel.api.security.SecurityContext) GraphDatabaseFacade(org.neo4j.kernel.impl.factory.GraphDatabaseFacade) LogService(org.neo4j.logging.internal.LogService)

Aggregations

DependencyResolver (org.neo4j.common.DependencyResolver)2 Edition (org.neo4j.common.Edition)2 Config (org.neo4j.configuration.Config)2 SystemGraphComponents (org.neo4j.dbms.database.SystemGraphComponents)2 Node (org.neo4j.graphdb.Node)2 Relationship (org.neo4j.graphdb.Relationship)2 Transaction (org.neo4j.graphdb.Transaction)2 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections.emptyIterator (java.util.Collections.emptyIterator)1 Collections.singletonList (java.util.Collections.singletonList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 IntSupplier (java.util.function.IntSupplier)1