-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-13190 #7984
IGNITE-13190 #7984
Changes from 91 commits
5c0bb03
f9abfb4
a979a2a
8e361c4
d922b36
495c68e
9e6754e
4ccb5a0
1e013a7
8990604
da70362
560ad16
5066364
62d6fdd
e506a1b
e000ab2
8e68138
e173af0
f104b0b
51706e8
3a150fe
0ffb7e6
b395fff
cf88708
1d6f103
deb3527
e04858d
2f50851
6ab14b7
8ff3e5f
9563932
678f46b
5270a26
7100748
30fba1f
6d28a7b
dc3388e
a222a54
7fb3362
e8509f1
555485a
f4da2c5
d4f5324
1daf29c
6d4276e
a15b4cf
75ee7c3
66e5c27
a937c07
a1b7442
aa3c723
ff452df
37cc862
d21ac60
33acaa2
6e91f1f
81db3b6
8785422
19ca7ee
1b17c8b
dce6a73
bdc9662
ced2dac
7a244b9
a3795fa
52a5f4a
7d752f6
d3fc45f
bc2e16c
9abcf15
1c899d2
7e15622
99c5d99
8d96744
88464df
2cf598f
f32d2ac
cbc5614
10af061
7d2a375
ce9d890
c5aedc3
4b16d75
ce6715c
adfbd5c
c943aab
9a28415
96944ff
893ed7d
e6b3830
d0efe52
3fce806
bb18443
87fd6fc
fb3b458
3c19a84
58125c1
d9f3836
8382f6b
4809e35
cbcd198
4ea97a9
b86f240
55b08fe
bc45e61
64fa01e
da4e14e
8118ec4
1b7d8ee
c1c6747
15554bd
1f5a1cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.ignite.configuration; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
*/ | ||
public final class DefragmentationConfiguration implements Serializable { | ||
/** Serial version uid. */ | ||
private static final long serialVersionUID = 0L; | ||
|
||
/** | ||
* | ||
*/ | ||
public static final long DFLT_MAPPIN_REGION_SIZE = 256L * 1024 * 1024; | ||
|
||
/** | ||
* | ||
*/ | ||
private long regionSize = DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE; | ||
|
||
/** | ||
* | ||
*/ | ||
private long mappingRegionSize = DFLT_MAPPIN_REGION_SIZE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we calculate defragmentation regions automatically? For example, the mapping region size can be calculated as max(size of the cache) * C (we store a link->link mapping, so the region size can be estimated pretty much accurately). If this is something viable, I would move these configuration parameters to system properties so that user does not have to configure anything at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @akalash will merge similar fix soon. |
||
|
||
/** | ||
* @return Region size. | ||
*/ | ||
public long getRegionSize() { | ||
return regionSize; | ||
} | ||
|
||
/** | ||
* @param regionSize | ||
*/ | ||
public DefragmentationConfiguration setRegionSize(long regionSize) { | ||
this.regionSize = regionSize; | ||
|
||
return this; | ||
} | ||
|
||
/** | ||
* @return Mapping region size. | ||
*/ | ||
public long getMappingRegionSize() { | ||
return mappingRegionSize; | ||
} | ||
|
||
/** | ||
* @param mappingRegionSize | ||
*/ | ||
public DefragmentationConfiguration setMappingRegionSize(long mappingRegionSize) { | ||
this.mappingRegionSize = mappingRegionSize; | ||
|
||
return this; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.ignite.internal.processors.cache.persistence.defragmentation; | ||
|
||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** */ | ||
public class CacheDefragmentationContext { | ||
/** */ | ||
|
||
/** */ | ||
private final Set<Integer> cacheGroupsForDefragmentation; | ||
|
||
/** | ||
* @param cacheGroupsForDefragmentation Cache group ids for defragmentation. | ||
*/ | ||
public CacheDefragmentationContext( | ||
List<Integer> cacheGroupsForDefragmentation | ||
) { | ||
|
||
this.cacheGroupsForDefragmentation = new HashSet<>(cacheGroupsForDefragmentation); | ||
} | ||
|
||
/** */ | ||
public Set<Integer> cacheGroupsForDefragmentation() { | ||
return cacheGroupsForDefragmentation; | ||
} | ||
|
||
/** */ | ||
public void onCacheGroupDefragmented(int grpId) { | ||
// Invalidate page stores. | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a dedicated
DefragmentationConfiguration
? Can we store all these properties inDataStorageConfiguration
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can, it's a subject for discussion I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest minimizing changes. If the wider defragmentation configuration scope appears we can create a such a class configuration, but currently, I see no reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll try to derive region sizes from current configuration. Not exactly the same way as @agoncharuk described, but approach will be similar. I hope that it won't take much time.