alibaba

alibaba

Alibaba Open Source

Member Since 9 years ago

Hangzhou, China

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
412
repos
Activity
Jan
27
3 hours ago
started
started time in 1 minute ago
started
started time in 2 minutes ago
push

sighingnow push alibaba/fastFFI

sighingnow
sighingnow

Generate bindings for typedef that with unsupported underlying types.

The underlying type of a typedef type might be too complex to support, e.g.,

#pragma once

#include <memory>

namespace vineyard {

template <typename T>
struct Factory {
    using type = T;
};

template <typename T>
class Array {
  public:
    using ArrayType1 = typename Factory<int>::type;
    using ArrayType2 = typename Factory<T>::type;

    std::shared_ptr<ArrayType1> get1() {
      return nullptr;
    }

    void set1(std::shared_ptr<ArrayType1>) {}

    std::shared_ptr<ArrayType2> get2() {
      return nullptr;
    }

    void set2(std::shared_ptr<ArrayType2>) {}
};

}

Where dependent name typename Factory<T>::type is involved, we choose to generate an empty interface (without the get() method) for it, instead of discard the whole. See ArrayType2 blow.

@FFITypeAlias("vineyard::Array")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface Array<T> extends FFIPointer {
  @CXXValue
  @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType1>")
  shared_ptr<ArrayType1> get1();

  void set1(
      @CXXValue @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType1>") shared_ptr<ArrayType1> arg0);

  @CXXValue
  @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType2>")
  shared_ptr<ArrayType2> get2();

  void set2(
      @CXXValue @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType2>") shared_ptr<ArrayType2> arg0);

  @FFITypeAlias("vineyard::Array::ArrayType1")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface ArrayType1 extends CXXPointer {
    @FFIExpr("{0}")
    Factory.TypeInt get();
  }

  @FFITypeAlias("vineyard::Array::ArrayType2")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface ArrayType2 extends CXXPointer {
  }
}

Build [email protected]
Build [email protected]
package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.CXXPointer;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::Factory")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface Factory<T> extends FFIPointer {
  @FFITypeAlias("vineyard::Factory<int>::type")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface TypeInt extends CXXPointer {
  }
}

Signed-off-by: Tao He [email protected]

sighingnow
sighingnow

Merge pull request #18 from sighingnow/ht/dependent-name-type

Generate bindings for typedef that with unsupported underlying types.

commit sha: 5ba5e1aab9bd5ec93d34368d2295cf6d28fe9e41

push time in 4 minutes ago
pull request

sighingnow pull request alibaba/fastFFI

sighingnow
sighingnow

Generate bindings for typedef that with unsupported underlying types.

The underlying type of a typedef type might be too complex to support, e.g.,

#pragma once

#include <memory>

namespace vineyard {

template <typename T>
struct Factory {
    using type = T;
};

template <typename T>
class Array {
  public:
    using ArrayType1 = typename Factory<int>::type;
    using ArrayType2 = typename Factory<T>::type;

    std::shared_ptr<ArrayType1> get1() {
      return nullptr;
    }

    void set1(std::shared_ptr<ArrayType1>) {}

    std::shared_ptr<ArrayType2> get2() {
      return nullptr;
    }

    void set2(std::shared_ptr<ArrayType2>) {}
};

}

Where dependent name typename Factory<T>::type is involved, we choose to generate an empty interface (without the get() method) for it, instead of discard the whole. See ArrayType2 blow.

@FFITypeAlias("vineyard::Array")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface Array<T> extends FFIPointer {
  @CXXValue
  @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType1>")
  shared_ptr<ArrayType1> get1();

  void set1(
      @CXXValue @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType1>") shared_ptr<ArrayType1> arg0);

  @CXXValue
  @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType2>")
  shared_ptr<ArrayType2> get2();

  void set2(
      @CXXValue @FFITypeAlias("std::shared_ptr<vineyard::Array::ArrayType2>") shared_ptr<ArrayType2> arg0);

  @FFITypeAlias("vineyard::Array::ArrayType1")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface ArrayType1 extends CXXPointer {
    @FFIExpr("{0}")
    Factory.TypeInt get();
  }

  @FFITypeAlias("vineyard::Array::ArrayType2")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface ArrayType2 extends CXXPointer {
  }
}

Build [email protected]
Build [email protected]
package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.CXXPointer;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::Factory")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface Factory<T> extends FFIPointer {
  @FFITypeAlias("vineyard::Factory<int>::type")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface TypeInt extends CXXPointer {
  }
}

Resolves #12.

Activity icon
issue

sighingnow issue alibaba/fastFFI

sighingnow
sighingnow

Failed to processing types that involves `using` a dependent name type

C++ source code for reproduce:

#pragma once

#include <memory>

namespace vineyard {

template <typename T>
struct Factory {
    using type = T;
};

template <typename T>
class Array {
  public:
    using ArrayType = typename Factory<T>::type;

    std::shared_ptr<ArrayType> get();

    void set(std::shared_ptr<ArrayType>);
};

}
push

sighingnow push alibaba/fastFFI

sighingnow
sighingnow

Implements bindings for template specialization and generates correct context.

Signed-off-by: Tao He [email protected]

sighingnow
sighingnow

Non-type argument is not supported.

Signed-off-by: Tao He [email protected]

sighingnow
sighingnow

Merge pull request #17 from sighingnow/ht/template-specialization

Implements bindings for template specialization and generates correct context.

commit sha: 6fbd60c31a48bbaa9c534f380aca70210f9922e3

push time in 5 minutes ago
pull request

sighingnow pull request alibaba/fastFFI

sighingnow
sighingnow

Implements bindings for template specialization and generates correct context.

Resolves #16.

For source code in #16,

namespace vineyard {
struct BoolArr {
};

template <typename T>
struct ConvertToArrowType {};

template <>
struct ConvertToArrowType<bool> {
    using ArrayType = BoolArr;
};

class __attribute__((annotate("vineyard"))) BooleanArray {
 private:
public:
  using ArrayType = typename ConvertToArrowType<bool>::ArrayType;

  ArrayType* GetArray() const;
};
}  // namespace

Now we will generate java bindings

package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.CXXPointer;
import com.alibaba.fastffi.FFIExpr;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::BooleanArray")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface BooleanArray extends FFIPointer {
  ArrayType GetArray();

  @FFITypeAlias("vineyard::BooleanArray::ArrayType")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface ArrayType extends CXXPointer {
    @FFIExpr("{0}")
    ConvertToArrowType.ArrayTypeBool get();
  }
}

package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::BoolArr")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface BoolArr extends FFIPointer {
}

Build [email protected]
Build [email protected]
package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.CXXPointer;
import com.alibaba.fastffi.FFIExpr;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::ConvertToArrowType")
@FFIGen
@CXXHead("basic/ds/arrow-x.vineyard.h")
public interface ConvertToArrowType<T> extends FFIPointer {
  @FFITypeAlias("vineyard::ConvertToArrowType<bool>::ArrayType")
  @FFIGen
  @CXXHead("basic/ds/arrow-x.vineyard.h")
  interface ArrayTypeBool extends CXXPointer {
    @FFIExpr("{0}")
    BoolArr get();
  }
}

Note that a ArrayTypeBool will be generated for the template instantiation vineyard::ConvertToArrowType<bool>::ArrayType.

Activity icon
issue

sighingnow issue alibaba/fastFFI

sighingnow
sighingnow

[Bug] Type alias used but not generated

C++ code

namespace vineyard {
struct BoolArr {
};

template <typename T>
struct ConvertToArrowType {};

template <>
struct ConvertToArrowType<bool> {
    using ArrayType = BoolArr;
};

class __attribute__((annotate("vineyard"))) BooleanArray {
 private:
public:
  using ArrayType = typename ConvertToArrowType<bool>::ArrayType;

  ArrayType* GetArray() const;
};
}  // namespace

Generates Java code

package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.CXXPointer;
import com.alibaba.fastffi.FFIExpr;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::BooleanArray")
@FFIGen
@CXXHead("basic/ds/arrow.vineyard.h")
public interface BooleanArray extends FFIPointer {
  ArrayType GetArray();

  @FFITypeAlias("vineyard::BooleanArray::ArrayType")
  @FFIGen
  @CXXHead("basic/ds/arrow.vineyard.h")
  interface ArrayType extends CXXPointer {
    @FFIExpr("{0}")
    vineyard.ArrayType get();
  }
}

package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::BoolArr")
@FFIGen
@CXXHead("basic/ds/arrow.vineyard.h")
public interface BoolArr extends FFIPointer {
}

Build [email protected]
package vineyard;

import com.alibaba.fastffi.CXXHead;
import com.alibaba.fastffi.FFIGen;
import com.alibaba.fastffi.FFIPointer;
import com.alibaba.fastffi.FFITypeAlias;

@FFITypeAlias("vineyard::ConvertToArrowType")
@FFIGen
@CXXHead("basic/ds/arrow.vineyard.h")
public interface ConvertToArrowType<T> extends FFIPointer {
}

Note that a vineyard.ArrayType is used, but not generated.

started
started time in 5 minutes ago
Activity icon
issue

Fanoid issue comment alibaba/Alink

Fanoid
Fanoid

StratifiedSampleBatchOp执行空指针问题

您好,使用StratifiedSampleBatchOp组件做采样时,如下设置,在执行时报空指针 new StratifiedSampleBatchOp() .setStrataRatios("0:0.05,1:1.0")

异常信息如下: java.lang.NullPointerException: 0 is not contained in map! at org.apache.flink.util.Preconditions.checkNotNull(Preconditions.java:76) ~[flink-core-1.12.3.jar:1.12.3] at com.alibaba.alink.operator.batch.dataproc.StratifiedSampleBatchOp$StratifiedSampleReduce.reduce(StratifiedSampleBatchOp.java:87)

打断点发现fractionMap在put时,key是String,但是get时是Object,并不一致,导致获取的fraction为null,请问如何设置才能正确获取数据? image

Fanoid
Fanoid

看起来是数据中这一列是整型,不是字符串类型,导致 key 查不到。

started
started time in 11 minutes ago
pull request

sighingnow merge to alibaba/GraphScope

sighingnow
sighingnow

[networkx] binding session from graphscope graph and fix bug

What do these changes do?

Related issue number

Fixes #1288 Fixes #1282

started
started time in 13 minutes ago
started
started time in 14 minutes ago
push

tanghaoth90 push alibaba/dragonwell11

tanghaoth90
tanghaoth90

[GC] 8233073: Make BitMap accessors more memory ordering friendly

Summary: Backport JDK-8233073 for ZGC. https://github.com/openjdk/jdk/commit/f07d377d6f252

Reviewed-by: weixlu, mmyxym

Test Plan: test/hotspot/jtreg/gc/z/

Issue: https://github.com/alibaba/dragonwell11/pull/194

tanghaoth90
tanghaoth90

[GC] 8233061: ZGC: Enforce memory ordering in segmented bit maps

Summary: Backport 8233061 for ZGC. https://github.com/openjdk/jdk/commit/db15bf5174 Conflicts: src/hotspot/share/gc/z/zLiveMap.inline.hpp (ZLiveMap::set_segment_live_atomic is renamed in JDK-8233797 which has been ported to Dragonwell11).

Reviewed-by: weixlu, mmyxym

Test Plan: test/hotspot/jtreg/gc/z/

Issue: https://github.com/alibaba/dragonwell11/pull/194

commit sha: 94713faf4d17903ff9e19f0a20db9aeab14abab1

push time in 15 minutes ago
pull request

tanghaoth90 pull request alibaba/dragonwell11

tanghaoth90
tanghaoth90

[Backport] ZGC: Enforce memory ordering in segmented bit maps

Activity icon
fork

tonny008 forked alibaba/x-render

⚡ 🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
tonny008 Updated
fork time in 15 minutes ago
open pull request

lidongze0629 wants to merge alibaba/GraphScope

lidongze0629
lidongze0629

[WIP] Add 'large_attr' data structure in op definition for large chunk (data of pandas/numpy)

What do these changes do?

TODO:

  • Avoid multiple copy of data (numpy/pandas)

Related issue number

links #1290

lidongze0629
lidongze0629

I will double-check any possible copy both in c++ and python side.

pull request

lidongze0629 merge to alibaba/GraphScope

lidongze0629
lidongze0629

[WIP] Add 'large_attr' data structure in op definition for large chunk (data of pandas/numpy)

What do these changes do?

TODO:

  • Avoid multiple copy of data (numpy/pandas)

Related issue number

links #1290

started
started time in 17 minutes ago
open pull request

linearhit wants to merge alibaba/BladeDISC

linearhit
linearhit

[disc-cpu] optimize the default layout of conv op

pull request

linearhit merge to alibaba/BladeDISC

linearhit
linearhit

[disc-cpu] optimize the default layout of conv op

Activity icon
fork

youshaox forked alibaba/x-deeplearning

⚡ An industrial deep learning framework for high-dimension sparse data
youshaox Apache License 2.0 Updated
fork time in 18 minutes ago
Activity icon
fork

zyklon2 forked alibaba/ilogtail

⚡ The Lightweight Data Collector of SLS in Alibaba Cloud
zyklon2 Apache License 2.0 Updated
fork time in 20 minutes ago
Activity icon
fork

zyklon2 forked alibaba/arthas

⚡ Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas
zyklon2 Apache License 2.0 Updated
fork time in 20 minutes ago
Activity icon
fork

zyklon2 forked alibaba/spring-cloud-alibaba

⚡ Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
zyklon2 Apache License 2.0 Updated
fork time in 21 minutes ago
Activity icon
issue

roy500 issue comment alibaba/Sentinel

roy500
roy500

提供spring的全局异常处理器,会导致熔断规则(异常数规则)失效解决方案

Describe what this PR does / why we need it

srntinel-spring-webmvc-adapter使用HandlerInterceptor做异常统计等处理,但在实际开发中都会用@ControllerAdvice全局异常处理如下: image

因为拦截顺序会按照controller -> aspect -> controllerAdvice -> interceptor -> filter往下走,这导致异常已在ControllerAdvice被捕获处理,HandlerInterceptor无法统计异常

Does this pull request fix one issue?

Fixes #2461

Describe how you did it

在AbstractSentinelInterceptor下添加与afterCompletion处理相同的方法exceptionControllerAdviceExit,提供给全局异常捕获类调用如下: image image 这样就可以捕获系统异常,自定义的业务异常也是同样调用,这里也不用担心会统计两次afterCompletion下的increaseReferece做了判断

Describe how to verify it

只要定义异常捕获处理都无法对异常进行统计,业务异常也是如此 image

Special notes for reviews

roy500
roy500

@brotherlu-xcq 但是我并没有修改到编译失败的项目,之前也有这样的情况,还请帮忙看下 image

started
started time in 23 minutes ago
open pull request

sighingnow wants to merge alibaba/GraphScope

sighingnow
sighingnow

[WIP] Add 'large_attr' data structure in op definition for large chunk (data of pandas/numpy)

What do these changes do?

TODO:

  • Avoid multiple copy of data (numpy/pandas)

Related issue number

links #1290

sighingnow
sighingnow

Will the cmd.large_attr be copied? or just a reference?

Previous