Skip to content

Commit bdb43eb

Browse files
author
zhangjunfeng
committed
crud ui add
1 parent 1733882 commit bdb43eb

81 files changed

Lines changed: 489 additions & 508 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ public class FileSystemConfiguration {
9090

9191
/** File's data block size (bytes). */
9292
private int blockSize = DFLT_BLOCK_SIZE;
93+
94+
/** File's data backups size (bytes). */
95+
private int backups = 0;
9396

9497
/** The number of pre-fetched blocks if specific file's chunk is requested. */
9598
private int prefetchBlocks;
@@ -173,6 +176,7 @@ public FileSystemConfiguration(FileSystemConfiguration cfg) {
173176
* Must preserve alphabetical order!
174177
*/
175178
blockSize = cfg.getBlockSize();
179+
backups = cfg.getBackups();
176180
bufSize = cfg.getBufferSize();
177181
colocateMeta = cfg.isColocateMetadata();
178182
dataCacheCfg = cfg.getDataCacheConfiguration();
@@ -288,6 +292,29 @@ public int getBlockSize() {
288292
return blockSize;
289293
}
290294

295+
/**
296+
* Sets file's data backups size.
297+
*
298+
* @param backups File's data backups or {@code -1} to reset default value.
299+
* @return {@code this} for chaining.
300+
*/
301+
public FileSystemConfiguration setBackups(int backups) {
302+
A.ensure(backups >= 0, "backups >= 0");
303+
304+
this.backups = backups;
305+
306+
return this;
307+
}
308+
309+
/**
310+
* Get file's data backups size.
311+
*
312+
* @return File's data backups size.
313+
*/
314+
public int getBackups() {
315+
return backups;
316+
}
317+
291318
/**
292319
* Sets file's data block size.
293320
*

modules/igfs/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public static void prepareCacheConfigurations(IgniteConfiguration cfg) throws Ig
408408
CacheConfiguration ccfgMeta = igfsCfg.getMetaCacheConfiguration();
409409

410410
if (ccfgMeta == null) {
411-
ccfgMeta = defaultMetaCacheConfig();
411+
ccfgMeta = defaultMetaCacheConfig(igfsCfg);
412412

413413
igfsCfg.setMetaCacheConfiguration(ccfgMeta);
414414
}
@@ -420,7 +420,7 @@ public static void prepareCacheConfigurations(IgniteConfiguration cfg) throws Ig
420420
CacheConfiguration ccfgData = igfsCfg.getDataCacheConfiguration();
421421

422422
if (ccfgData == null) {
423-
ccfgData = defaultDataCacheConfig();
423+
ccfgData = defaultDataCacheConfig(igfsCfg);
424424

425425
igfsCfg.setDataCacheConfiguration(ccfgData);
426426
}
@@ -527,36 +527,40 @@ private static void validateLocalIgfsConfigurations(IgniteConfiguration igniteCf
527527
}
528528
}
529529

530+
531+
530532
/**
531-
* @return Default IGFS cache configuration.
533+
* @return Default IGFS meta cache configuration.
532534
*/
533-
private static CacheConfiguration defaultCacheConfig() {
534-
CacheConfiguration cfg = new CacheConfiguration();
535+
private static CacheConfiguration defaultMetaCacheConfig(FileSystemConfiguration igfsCfg) {
536+
CacheConfiguration cfg = new CacheConfiguration();
535537
cfg.setAtomicityMode(TRANSACTIONAL);
536538
cfg.setWriteSynchronizationMode(FULL_SYNC);
537539
cfg.setCacheMode(CacheMode.PARTITIONED);
540+
if(igfsCfg.isColocateMetadata()) {
541+
cfg.setCacheMode(CacheMode.REPLICATED);
542+
}
543+
else {
544+
cfg.setBackups(1);
545+
}
538546

539547
return cfg;
540548
}
541549

542550
/**
543-
* @return Default IGFS meta cache configuration.
551+
* @return Default IGFS data cache configuration.
544552
*/
545-
private static CacheConfiguration defaultMetaCacheConfig() {
546-
CacheConfiguration cfg = defaultCacheConfig();
547-
548-
cfg.setBackups(1);
553+
private static CacheConfiguration defaultDataCacheConfig(FileSystemConfiguration igfsCfg) {
554+
CacheConfiguration cfg = new CacheConfiguration();
555+
cfg.setAtomicityMode(TRANSACTIONAL);
556+
cfg.setWriteSynchronizationMode(FULL_SYNC);
557+
cfg.setCacheMode(CacheMode.PARTITIONED);
558+
if(igfsCfg.getBackups()>=0)
559+
cfg.setBackups(igfsCfg.getBackups());
549560

550561
return cfg;
551562
}
552563

553-
/**
554-
* @return Default IGFS data cache configuration.
555-
*/
556-
private static CacheConfiguration defaultDataCacheConfig() {
557-
return defaultCacheConfig();
558-
}
559-
560564
/**
561565
* Create empty directory with the given ID.
562566
*

web-console/DBMetadata/DBMetadata-generator/src/main/java/org/apache/ignite/console/agent/code/CrudUICodeGenerator.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.io.FileOutputStream;
55
import java.io.IOException;
66
import java.util.ArrayList;
7+
import java.util.Collection;
78
import java.util.List;
89
import java.util.Map;
910
import java.util.zip.ZipOutputStream;
@@ -45,20 +46,26 @@ private void generatorTable(GenConfig config,Map<String,Object> context) throws
4546
}
4647
}
4748

48-
public List<String> generator(String destPath, Map<String,Object> context) {
49+
public List<String> generator(String destPath, Map<String,Object> context, Collection<String> validTokens) {
4950
List<String> message = new ArrayList<>();
5051
GenConfig config = new GenConfig();
51-
String pkgPath = destPath+"org/demo/";
52-
String domain = "Test";
53-
52+
String pkgPath = "org.demo";
53+
String name = context.get("name").toString();
54+
boolean isLastNode = (Boolean)context.getOrDefault("isLastNode",true);
55+
if(!isLastNode){
56+
return message;
57+
}
58+
boolean demo = (Boolean)context.getOrDefault("demo",false);
59+
List<Map<String,String>> attributes = (List)context.get("attributes");
60+
List<String> models = (List)context.get("models");
61+
List<String> caches = (List)context.get("caches");
5462
try {
55-
config.setPackageName(destPath+"org/demo/");
56-
config.setFileDownLoadPath(destPath);
63+
config.setPackageName(pkgPath);
64+
config.setFileDownLoadPath(destPath+"src/java");
5765
config.setAuthor("demo");
5866
generatorTable(config,context);
5967

6068
} catch (IOException e) {
61-
6269
e.printStackTrace();
6370
message.add(e.getMessage());
6471
}

web-console/DBMetadata/DBMetadata-generator/src/test/java/org/apache/ignite/console/agent/code/CrudUICodeGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void tearDown() throws Exception {
1515

1616
public void testGenCode(){
1717
JsonObject context = new JsonObject("");
18-
gen.generator("/tmp/code",context.getMap());
18+
gen.generator("/tmp/code",context.getMap(),null);
1919
}
2020

2121
public static void main(String[] args) throws Exception {

web-console/frontend/app/components/ui-grid/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
import _ from 'lodash';
33
import debounce from 'lodash/debounce';
44
import headerTemplate from 'app/primitives/ui-grid-header/index.tpl.pug';
55

web-console/frontend/app/components/web-console-header/components/help-menu/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ help-menu {
1313
.help-menu__trigger {
1414
display: flex;
1515
max-height: 100%;
16-
}
16+
}
1717
}

web-console/frontend/app/components/web-console-header/components/user-menu/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ user-menu {
2424
display: flex;
2525
max-height: 100%;
2626
overflow: hidden;
27-
}
27+
}
2828
}

web-console/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ include /app/configuration/mixins
88
-var nodeFilter = model + '.nodeFilter';
99
-var nodeFilterKind = nodeFilter + '.kind';
1010
-var customFilter = nodeFilterKind + ' === "Custom"'
11+
-var igfsFilter = nodeFilterKind + ' === "IGFS"'
1112

1213
panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`)
1314
panel-title Node filter
@@ -49,4 +50,4 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`)
4950
validationActive: customFilter
5051
})
5152
.pca-form-column-6
52-
+preview-xml-java(model, 'cacheNodeFilter','igfss')
53+
+preview-xml-java(model, 'cacheNodeFilter', '$ctrl.igfss')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22

3-
cache-edit-form {
3+
cluster-edit-form {
44
display: block;
55
}

web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`)
122122
name: 'cipherSuite',
123123
itemName: 'cipher suite',
124124
itemsName: 'cipher suites'
125-
126125
})(
127126
list-editable-cols=`::[{name: 'Suites:'}]`
128127
ng-disabled=`!(${enabled})`

0 commit comments

Comments
 (0)