Skip to content

Commit

Permalink
mongo-dataset-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjunfeng committed Sep 11, 2024
1 parent c1cb96f commit 2a4db2c
Show file tree
Hide file tree
Showing 155 changed files with 18,335 additions and 201 deletions.
25 changes: 12 additions & 13 deletions examples/config/example-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<bean abstract="true" id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<!-- Set to true to enable distributed class loading for examples, default is false. -->

<property name="localHost" value="127.0.0.1"/>

<property name="peerClassLoadingEnabled" value="false"/>

<property name="binaryConfiguration">
Expand Down Expand Up @@ -63,26 +63,25 @@
</property>

<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<!-- <property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<!--
Ignite provides several options for automatic discovery that can be used
instead os static IP based discovery. For information on all options refer
to our documentation: http://apacheignite.readme.io/docs/cluster-config
-->
<!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
<!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="localAddress" value="127.0.0.1" ></property>
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<list>
<value>127.0.0.1:47500..47509</value>
</list>
</property>
</bean>
</property>
</bean>
</property> -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.isolated.IsolatedDiscoverySpi">
</bean>
</property>


</bean>
</beans>
4 changes: 2 additions & 2 deletions examples/config/example-igfs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
to our documentation: http://apacheignite.readme.io/docs/cluster-config
-->
<!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
<!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<!---->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class CacheClientBinaryPutGetExample {
* @param args Command line arguments, none required.
*/
public static void main(String[] args) {
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
try (Ignite ignite = Ignition.start("config/example-ignite.xml")) {
System.out.println();
System.out.println(">>> Binary objects cache put-get example started.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,13 @@ boolean readBoolean(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException If failed.
*/
short readShort(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(SHORT) == Flag.NORMAL ? in.readShort() : 0;
//- return findFieldById(fieldId) && checkFlagNoHandles(SHORT) == Flag.NORMAL ? in.readShort() : 0;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(SHORT);
if(flag == Flag.NORMAL) return in.readShort();
if(flag == Flag.UPWARD) return in.readByte();
}
return 0;
}

/**
Expand All @@ -606,7 +612,13 @@ short readShort(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException In case of error.
*/
@Nullable Short readShortNullable(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(SHORT) == Flag.NORMAL ? in.readShort() : null;
//- return findFieldById(fieldId) && checkFlagNoHandles(SHORT) == Flag.NORMAL ? in.readShort() : null;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(SHORT);
if(flag == Flag.NORMAL) return in.readShort();
if(flag == Flag.UPWARD) return Short.valueOf(in.readByte());
}
return null;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -729,7 +741,13 @@ char readChar(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException If failed.
*/
int readInt(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(INT) == Flag.NORMAL ? in.readInt() : 0;
//- return findFieldById(fieldId) && checkFlagNoHandles(INT) == Flag.NORMAL ? in.readInt() : 0;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(INT);
if(flag == Flag.NORMAL) return in.readInt();
if(flag == Flag.UPWARD) return in.readShort();
}
return 0;
}

/**
Expand All @@ -738,7 +756,13 @@ int readInt(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException In case of error.
*/
@Nullable Integer readIntNullable(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(INT) == Flag.NORMAL ? in.readInt() : null;
//- return findFieldById(fieldId) && checkFlagNoHandles(INT) == Flag.NORMAL ? in.readInt() : null;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(INT);
if(flag == Flag.NORMAL) return in.readInt();
if(flag == Flag.UPWARD) return Integer.valueOf(in.readShort());
}
return null;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -795,7 +819,13 @@ int readInt(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException If failed.
*/
long readLong(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(LONG) == Flag.NORMAL ? in.readLong() : 0;
//- return findFieldById(fieldId) && checkFlagNoHandles(LONG) == Flag.NORMAL ? in.readLong() : 0;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(LONG);
if(flag == Flag.NORMAL) return in.readLong();
if(flag == Flag.UPWARD) return in.readInt();
}
return 0;
}

/**
Expand All @@ -804,7 +834,13 @@ long readLong(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException In case of error.
*/
@Nullable Long readLongNullable(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(LONG) == Flag.NORMAL ? in.readLong() : null;
//- return findFieldById(fieldId) && checkFlagNoHandles(LONG) == Flag.NORMAL ? in.readLong() : null;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(LONG);
if(flag == Flag.NORMAL) return in.readLong();
if(flag == Flag.UPWARD) return Long.valueOf(in.readInt());
}
return null;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -927,7 +963,13 @@ float readFloat(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException If failed.
*/
double readDouble(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(DOUBLE) == Flag.NORMAL ? in.readDouble() : 0;
//- return findFieldById(fieldId) && checkFlagNoHandles(DOUBLE) == Flag.NORMAL ? in.readDouble() : 0;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(DOUBLE);
if(flag == Flag.NORMAL) return in.readDouble();
if(flag == Flag.UPWARD) return in.readFloat();
}
return 0;
}

/**
Expand All @@ -936,7 +978,13 @@ float readFloat(int fieldId) throws BinaryObjectException {
* @throws BinaryObjectException In case of error.
*/
@Nullable Double readDoubleNullable(int fieldId) throws BinaryObjectException {
return findFieldById(fieldId) && checkFlagNoHandles(DOUBLE) == Flag.NORMAL ? in.readDouble() : null;
//- return findFieldById(fieldId) && checkFlagNoHandles(DOUBLE) == Flag.NORMAL ? in.readDouble() : null;
if(findFieldById(fieldId)) {
Flag flag = checkFlagNoHandles(DOUBLE);
if(flag == Flag.NORMAL) return in.readDouble();
if(flag == Flag.UPWARD) return Double.valueOf(in.readFloat());
}
return null;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -1666,6 +1714,29 @@ else if (flag == NULL)
return Flag.NULL;
else if (flag == HANDLE)
return Flag.HANDLE;

// add@byron
if(flag<=6 && expFlag<=6) {
if (flag == 3 && expFlag==2) { // readShort for int value
return Flag.NORMAL;
}
if (flag == 2 && expFlag==3) { // readInt for short value
return Flag.UPWARD;
}
if (flag == 4 && expFlag==3) { // readInt for long value
return Flag.NORMAL;
}
if (flag == 3 && expFlag==4) { // readLong for int value
return Flag.UPWARD;
}
if (flag == 6 && expFlag==5) { // readFloat for double value
return Flag.NORMAL;
}
if (flag == 5 && expFlag==6) { // readDouble for float value
return Flag.UPWARD;
}
}
// end@

int pos = BinaryUtils.positionForHandle(in);

Expand All @@ -1687,7 +1758,35 @@ private Flag checkFlagNoHandles(byte expFlag) {
return Flag.NORMAL;
else if (flag == NULL)
return Flag.NULL;


// add@byron
if(flag<=6 && expFlag<=6) {
if (flag == 3 && expFlag==2) { // readShort for int value
return Flag.NORMAL;
}
if (flag == 2 && expFlag==3) { // readInt for short value
return Flag.UPWARD;
}
if (flag == 4 && expFlag==3) { // readInt for long value
return Flag.NORMAL;
}
if (flag == 3 && expFlag==4) { // readLong for int value
return Flag.UPWARD;
}
if (flag == 6 && expFlag==5) { // readFloat for double value
return Flag.NORMAL;
}
if (flag == 5 && expFlag==6) { // readDouble for float value
return Flag.UPWARD;
}
if (flag == 2 && expFlag==1) { // readByte for short value
return Flag.NORMAL;
}
if (flag == 1 && expFlag==2) { // readShort for byte value
return Flag.UPWARD;
}
}
// end@
int pos = BinaryUtils.positionForHandle(in);

throw new BinaryObjectException("Unexpected field type [pos=" + pos + ", expected=" + fieldFlagName(expFlag) +
Expand Down Expand Up @@ -2397,6 +2496,9 @@ private enum Flag {
HANDLE,

/** Null. */
NULL
NULL,

/** Upward compatibility */
UPWARD,
}
}
2 changes: 1 addition & 1 deletion web-console/frontend/app-angular/downgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import angular from 'angular';
import {ServiceBootstrapComponent} from './components/serviceBootstrap';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {downgradeModule, downgradeComponent } from '@angular/upgrade/static';
Expand Down
2 changes: 1 addition & 1 deletion web-console/frontend/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import angular from 'angular';

import './style.scss';

Expand Down
4 changes: 2 additions & 2 deletions web-console/frontend/app/components/ignite-icon/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default function() {
// templateNamespace: 'svg' does not work in IE11
this.wrapper.innerHTML = `<svg><use xlink:href="${url}" href="${url}" /></svg>`;

Array.from(this.wrapper.childNodes[0].childNodes).forEach((n) => {
this.$element.empty().append(n);
Array.from(this.wrapper.childNodes[0].childNodes).forEach((el) => {
this.$element.empty().append(el);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,17 @@ export class NotebookCtrl {
$location.hash(paragraph.id);
};

$scope.moveUpParagraph = (paragraph) => {

let index = $scope.notebook.paragraphs.indexOf(paragraph);
if(index<=0) return ;

// 将当前元素与其前一个元素交换
let arr = $scope.notebook.paragraphs;
[arr[index], arr[index - 1]] = [arr[index - 1], arr[index]];

};

$scope.addQuery = function() {
const sz = $scope.notebook.paragraphs.length;

Expand Down Expand Up @@ -2120,8 +2131,8 @@ export class NotebookCtrl {
available: (p) => this.$scope.scanAvailable(p)
},
{
text: this.$translate.instant('queries.notebook.scanActions.scanOnSelectedNode'),
click: (p) => this.$scope.scan(p, true),
text: this.$translate.instant('queries.notebook.queryActions.moveUpParagraph.buttonLabel'),
click: (p) => this.$scope.moveUpParagraph(p),
available: (p) => this.$scope.scanAvailable(p)
},
{
Expand All @@ -2143,8 +2154,8 @@ export class NotebookCtrl {
available: (p) => this.$scope.queryAvailable(p)
},
{
text: this.$translate.instant('queries.notebook.queryActions.executeOnSelectedNode.buttonLabel'),
click: (p) => this.$scope.execute(p, true),
text: this.$translate.instant('queries.notebook.queryActions.moveUpParagraph.buttonLabel'),
click: (p) => this.$scope.moveUpParagraph(p),
available: (p) => this.$scope.queryAvailable(p)
},
{
Expand Down
Loading

0 comments on commit 2a4db2c

Please sign in to comment.