See if following method helps
"org.apache.geode.cache.partition.PartitionRegionHelper.assignBucketsToPartitions".
This needs
to call when all servers are up.
/**
* Decide which partitions will host which buckets. Gemfire normally assigns
buckets to partitions
* as needed when data is added to a partitioned region. This method provides
way to assign all of
* the buckets without putting any data in partition region. This method
should not be called
* until all of the partitions are running because it will divide the buckets
between the running
* partitions. If the buckets are already assigned this method will have no
effect.
*
* This method will block until all buckets are assigned.
*
* @param region The region which should have it's buckets assigned.
* @throws IllegalStateException if the provided region is something other
than a
* {@linkplain DataPolicy#PARTITION partitioned Region}
* @since GemFire 6.0
*/
public static void assignBucketsToPartitions(Region<?, ?> region)
From: Amit Pandey <[email protected]>
To: [email protected]
Sent: Sunday, February 26, 2017 10:42 AM
Subject: How to preinitialize cache before use
Hi,
We have a region which we try to.
The first time we do that there is some logs like :-
[info 2017/02/27 00:09:55.089 IST <main> tid=0x1] Initialization of region
_B__lots_60 completed[info 2017/02/27 00:09:55.090 IST <main> tid=0x1]
Initializing region _B__lots_7[info 2017/02/27 00:09:55.090 IST <main> tid=0x1]
Initialization of region _B__lots_7 completed[info 2017/02/27 00:09:55.091 IST
<main> tid=0x1] Initializing region _B__lots_8[info 2017/02/27 00:09:55.091 IST
<main> tid=0x1] Initialization of region _B__lots_8 completed[info 2017/02/27
00:09:55.092 IST <main> tid=0x1] Initializing region _B__lots_9
And I see that inserts are much slower than later when its pretty fast..In
production this flow will be done once or twice a day and we need it to be as
fast as possible. Is there any way to preinitialize these things or avoid this
the first time it is used?
Regards