Skip to content

Commit

Permalink
web-console
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjunfeng committed Jul 26, 2024
1 parent 13933f6 commit 4325c4c
Show file tree
Hide file tree
Showing 63 changed files with 914 additions and 696 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class PermissionCrawler implements IPermCrawler, Runnable {

private static PermissionCrawler fPermCrawler = null;



private final Object fTrigger = new Object();

Expand Down Expand Up @@ -122,17 +121,13 @@ public void run() {
fActive = false;
}

try {
fLogger.log(Level.INFO, "starting permission crawl");
long time = System.currentTimeMillis();
fLogger.log(Level.INFO, "starting permission crawl");
long time = System.currentTimeMillis();

crawl();
crawl();

time = System.currentTimeMillis() - time;
fLogger.log(Level.INFO, "finished crawl in " + time + "ms");
} catch (Exception e) {
fLogger.log(Level.WARNING,e.getMessage());
}
time = System.currentTimeMillis() - time;
fLogger.log(Level.INFO, "finished crawl in " + time + "ms");
}
}

Expand All @@ -143,7 +138,7 @@ public void run() {
* @throws Exception
* if crawling fails
*/
public void crawl() throws Exception {
public void crawl() {
// clear users
fUsers.clear();

Expand Down Expand Up @@ -177,7 +172,7 @@ public void crawl() throws Exception {
}
}
} catch(Exception e) {
fLogger.log(Level.WARNING,e.getMessage());
fLogger.log(Level.INFO,e.getMessage());
}

// crawl all permissions for all users
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.apache.tinkerpop.gremlin.server.GraphManager;
import org.apache.tinkerpop.gremlin.structure.Graph;

import de.kp.works.ignite.gremlin.sql.IgniteGraphTraversalSource;

public class GremlinPlugin implements IgnitePlugin{

String databaseName;
Expand All @@ -21,4 +23,8 @@ public Graph getGraph() {
return graphManager.getGraph(databaseName);
}

public IgniteGraphTraversalSource traversal() {
return graphManager.getGraph(databaseName).traversal(IgniteGraphTraversalSource.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
package de.kp.works.ignite.gremlin.plugin;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.net.BindException;
import java.net.Socket;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
Expand All @@ -33,19 +30,15 @@
import org.apache.ignite.plugin.CachePluginContext;
import org.apache.ignite.plugin.CachePluginProvider;
import org.apache.ignite.plugin.ExtensionRegistry;
import org.apache.ignite.plugin.IgnitePlugin;
import org.apache.ignite.plugin.PluginConfiguration;
import org.apache.ignite.plugin.PluginContext;
import org.apache.ignite.plugin.PluginProvider;
import org.apache.ignite.plugin.PluginValidationException;
import org.apache.tinkerpop.gremlin.server.GraphManager;
import org.apache.tinkerpop.gremlin.server.GremlinServer;
import org.apache.tinkerpop.gremlin.server.Settings;
import org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;

import org.jetbrains.annotations.Nullable;

import de.kp.works.ignite.IgniteConnect;


Expand Down Expand Up @@ -198,7 +191,8 @@ public void onIgniteStart() {

} catch (Exception e) {
log.error("GremlinServer bind fail.", e);
throw new RuntimeException(e);
//-throw new RuntimeException(e);
gremlinServer = null;
}
}

Expand Down Expand Up @@ -228,7 +222,7 @@ public void onIgniteStop(boolean cancel) {
if (counter<=0 && gremlinServer!= null) {
try {
log.info("GremlinServer", "shutting down " + gremlinServer.toString());
gremlinServer.stop();
gremlinServer.stop();
gremlinServer = null;
} catch (Exception e) {
log.error("GremlinServer close fail.", e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.kp.works.janus.gremlin.plugin;

import org.apache.ignite.plugin.IgnitePlugin;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.server.GraphManager;
import org.apache.tinkerpop.gremlin.structure.Graph;

Expand All @@ -19,4 +20,8 @@ public Graph getGraph() {
return graphManager.getGraph(databaseName);
}

public GraphTraversalSource traversal() {
return graphManager.getGraph(databaseName).traversal();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ public void onIgniteStart() {
log.info("JanaGremlinServer", "listern on " + settings.host + ":" + settings.port);

} catch (Exception e) {
log.error("GremlinServer bind fail.", e);
throw new RuntimeException(e);
log.error("JanaGremlinServer bind fail.", e);
// throw new RuntimeException(e);
janusGraphServer = null;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheAbstractJdb
private Factory<DataSource> dataSrcFactory;

/** Flag indicating that table and field names should be escaped in all SQL queries created by JDBC POJO store. */
private boolean sqlEscapeAll;
private boolean sqlEscapeAll = true;

/** Application context. */
@SpringApplicationContextResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private void doCheckpoint() {
return;
}
else {
if (log.isInfoEnabled())
if (log.isDebugEnabled())
LT.info(log, String.format(
"Skipping checkpoint (no pages were modified) [" +
"checkpointBeforeLockTime=%dms, checkpointLockWait=%dms, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export class NotebookCtrl {

$scope.aggregateFxs = ['FIRST', 'LAST', 'MIN', 'MAX', 'SUM', 'AVG', 'COUNT'];

$scope.modes = LegacyUtils.mkOptions(['PARTITIONED', 'REPLICATED', 'LOCAL']);
$scope.modes = LegacyUtils.mkOptions(['PARTITIONED', 'REPLICATED']);

$scope.loadingText = this.Demo.enabled
? $translate.instant('queries.notebook.loadingMessageWithDemoEnabled')
Expand Down Expand Up @@ -1473,7 +1473,7 @@ export class NotebookCtrl {
rows.push([row.key, row.value])
}
paragraph.rows = rows;
}
}
else
paragraph.rows = res.rows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default class HelpMenu {

items = [
{text: 'Getting Started', click: '$ctrl.gettingStarted.tryShow(true)'},
{text: 'Documentation', href: 'https://docs.gridgain.com/docs/web-console', target: '_blank'},
{text: 'Forums', href: 'https://forums.gridgain.com/home', target: '_blank'},
{text: 'Support', href: 'https://gridgain.freshdesk.com/support/login', target: '_blank'},
{text: 'Whitepapers', href: 'https://www.gridgain.com/resources/literature/white-papers?combine=web+console&field_personas_target_id=All', target: '_blank'}
{text: 'Documentation', href: '/docs/web-console', target: '_blank'},
{text: 'Forums', href: '/forum#ignite', target: '_blank'},
{text: 'Support', href: '/support/login', target: '_blank'},
{text: 'Whitepapers', href: '/white-papers?combine=web+console&field_personas_target_id=All', target: '_blank'}
];
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import template from './template.pug';
import './style.scss';
import ModalImportModels from '../modal-import-models/service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ include /app/configuration/mixins

panel-collapsible(
ng-form=form
on-open=`ui.loadPanel('${form}')`
ng-hide=`${model}.cacheMode === "LOCAL"`
on-open=`ui.loadPanel('${form}')`
)
panel-title Rebalance
panel-description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class ClusterEditFormController {
this.$scope.ui.loadedPanels = ['checkpoint', 'serviceConfiguration', 'odbcConfiguration'];

this.formActions = [
{text: 'Save', icon: 'checkmark', click: () => this.save()},
{text: 'Save', icon: 'checkmark', click: () => this.save(false)},
{text: 'Save and Download', icon: 'download', click: () => this.save(true)}
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`)
name: '"cacheMode"',
placeholder: 'PARTITIONED',
options: '[\
{value: "LOCAL", label: "LOCAL"},\
{value: "REPLICATED", label: "REPLICATED"},\
{value: "PARTITIONED", label: "PARTITIONED"}\
]',
tip: 'Cache modes:\
<ul>\
<li>Partitioned - in this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes</li>\
<li>Replicated - in this mode all the keys are distributed to all participating nodes</li>\
<li>Local - in this mode caches residing on different grid nodes will not know about each other</li>\
</ul>'
})
.pc-form-grid-col-30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include /app/configuration/mixins
-var form = 'discovery'
-var model = '$ctrl.clonedCluster.discovery'

panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`)
panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')` ng-if=`${model}.kind !== 'ZooKeeper'`)
panel-title Discovery
panel-description
| TCP/IP discovery configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ export default class PageConfigureBasicController {
{
text: 'Deploy and ReStart',
click: () => this.deploy(true),
icon: 'download'
icon: 'refresh'
},
{
text: 'Deploy Only',
click: () => this.deploy(false),
icon: 'plus'
icon: 'expand'
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2344,15 +2344,13 @@ export default class IgniteConfigurationGenerator {

// Generate cache rebalance group.
static cacheRebalance(cache, ccfg = this.cacheConfigurationBean(cache)) {
if (ccfg.valueOf('cacheMode') !== 'LOCAL') {
ccfg.enumProperty('rebalanceMode')
.intProperty('rebalanceBatchSize')
.longProperty('rebalanceBatchesPrefetchCount')
.intProperty('rebalanceOrder')
.longProperty('rebalanceDelay')
.longProperty('rebalanceTimeout')
.longProperty('rebalanceThrottle');
}
ccfg.enumProperty('rebalanceMode')
.intProperty('rebalanceBatchSize')
.longProperty('rebalanceBatchesPrefetchCount')
.intProperty('rebalanceOrder')
.longProperty('rebalanceDelay')
.longProperty('rebalanceTimeout')
.longProperty('rebalanceThrottle');

return ccfg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ export default class IgniteMavenGenerator {

sb.startBlock('<plugin>');
this.addProperty(sb, 'artifactId', 'maven-compiler-plugin');
this.addProperty(sb, 'version', '3.1');
this.addProperty(sb, 'version', '3.6');
sb.startBlock('<configuration>');
this.addProperty(sb, 'source', '1.7');
this.addProperty(sb, 'target', '1.7');
this.addProperty(sb, 'source', '11');
this.addProperty(sb, 'target', '11');
sb.endBlock('</configuration>');
sb.endBlock('</plugin>');

Expand Down Expand Up @@ -169,7 +169,7 @@ export default class IgniteMavenGenerator {
const storeDeps = [];

this.addDependency(deps, artifactGrp, 'ignite-core', igniteVer);

this.addDependency(deps, artifactGrp, 'ignite-igfs', igniteVer);
this.addDependency(deps, artifactGrp, 'ignite-spring', igniteVer);
this.addDependency(deps, artifactGrp, 'ignite-indexing', igniteVer);
this.addDependency(deps, artifactGrp, 'ignite-rest-http', igniteVer);
Expand Down
2 changes: 0 additions & 2 deletions web-console/frontend/app/configuration/mixins.pug
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,13 @@ mixin form-field__cache-modes({ label, model, name, placeholder })
+form-field__dropdown({
label, model, name, placeholder,
options: '[\
{value: "LOCAL", label: "LOCAL"},\
{value: "REPLICATED", label: "REPLICATED"},\
{value: "PARTITIONED", label: "PARTITIONED"}\
]',
tip: 'Cache modes:\
<ul>\
<li>PARTITIONED - in this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes</li>\
<li>REPLICATED - in this mode all the keys are distributed to all participating nodes</li>\
<li>LOCAL - in this mode caches residing on different grid nodes will not know about each other</li>\
</ul>'
})&attributes(attributes)
if block
Expand Down
9 changes: 6 additions & 3 deletions web-console/frontend/app/configuration/services/Caches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import uuidv4 from 'uuid/v4';
import {CacheModes, AtomicityModes, ShortCache} from '../types';
import {Menu} from 'app/types';

const JDBC_LINKS = {
Oracle: 'https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html'
}

export default class Caches {
static $inject = ['$http'];

Expand Down Expand Up @@ -208,9 +212,8 @@ export default class Caches {
return cache && cache.cacheMode === 'PARTITIONED';
}

jdbcDriverURL(storeFactory) {
this.JDBC_LINKS = {}
return this.JDBC_LINKS[get(storeFactory, 'dialect')];
jdbcDriverURL(storeFactory) {
return JDBC_LINKS[get(storeFactory, 'dialect')];
}

requiresProprietaryDrivers(storeFactory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {tap, scan} from 'rxjs/operators';

export default class ConfigureState {
actions$: Subject<{type: string}>;

state$: BehaviorSubject<any>;
_combinedReducer: (state, action) => any;
constructor() {
this.actions$ = new Subject();
this.state$ = new BehaviorSubject({});
Expand Down
6 changes: 3 additions & 3 deletions web-console/frontend/app/configuration/services/Models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import omit from 'lodash/fp/omit';
import uuidv4 from 'uuid/v4';

Expand Down Expand Up @@ -109,7 +107,9 @@ ${scale && entity.precision && entity.scale ? ',' + entity.scale : ''}${precisio
id: uuidv4(),
name: '',
indexType: 'SORTED',
fields: []
fields: [],
inlineSize: null,
inlineSizeType: -1
});

return model.indexes[model.indexes.length - 1];
Expand Down
Loading

0 comments on commit 4325c4c

Please sign in to comment.