You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Kenneth Knowles (JIRA)" <ji...@apache.org> on 2016/05/02 19:05:13 UTC

[jira] [Updated] (BEAM-247) CombineFn's only definable/usable inside sdk.transforms package

     [ https://issues.apache.org/jira/browse/BEAM-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenneth Knowles updated BEAM-247:
---------------------------------
    Description: 
{code:java}
public abstract static class CombineFn<InputT, AccumT, OutputT>
  extends AbstractGlobalCombineFn<InputT, AccumT, OutputT> { /* ... */ }
abstract static class AbstractGlobalCombineFn<InputT, AccumT, OutputT>
  implements GlobalCombineFn<InputT, AccumT, OutputT>, Serializable { /* ... */ }
{code}

Since {{AbstractGlobalCombineFn}} is package protected (and therefore not visible outside of the {{transform}} package, it is not possible to cast any class that extends {{CombineFn}} to a {{GlobalCombineFn}} outside of this package.

This prevents applying existing {{CombineFns}} directly (such as {{Combine.perKey(new Sum.SumIntegersFn())}}, as used in our documentation) and also means that a user cannot define their own {{CombineFn}} unless they put them in the {{transform}} package.

  was:
{code:java}
public abstract static class CombineFn<InputT, AccumT, OutputT>
  extends AbstractGlobalCombineFn<InputT, AccumT, OutputT> { /* ... */ }
abstract static class AbstractGlobalCombineFn<InputT, AccumT, OutputT>
  implements GlobalCombineFn<InputT, AccumT, OutputT>, Serializable { /* ... */ }
{code}

Since {{AbstractGlobalCombineFn}} is package protected (and therefore not visible outside of the {{transform}} package, it is not possible to cast any class that extends {{CombineFn}} to a {{GlobalCombineFn}} outside of this package.

This prevents applying existing {{CombineFn}}s directly (such as {{Combine.perKey(new Sum.SumIntegersFn())}}, as used in our documentation) and also means that a user cannot define their own {{CombineFn}} unless they put them in the {{transform}} package.


> CombineFn's only definable/usable inside sdk.transforms package
> ---------------------------------------------------------------
>
>                 Key: BEAM-247
>                 URL: https://issues.apache.org/jira/browse/BEAM-247
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Ben Chambers
>            Assignee: Pei He
>            Priority: Critical
>
> {code:java}
> public abstract static class CombineFn<InputT, AccumT, OutputT>
>   extends AbstractGlobalCombineFn<InputT, AccumT, OutputT> { /* ... */ }
> abstract static class AbstractGlobalCombineFn<InputT, AccumT, OutputT>
>   implements GlobalCombineFn<InputT, AccumT, OutputT>, Serializable { /* ... */ }
> {code}
> Since {{AbstractGlobalCombineFn}} is package protected (and therefore not visible outside of the {{transform}} package, it is not possible to cast any class that extends {{CombineFn}} to a {{GlobalCombineFn}} outside of this package.
> This prevents applying existing {{CombineFns}} directly (such as {{Combine.perKey(new Sum.SumIntegersFn())}}, as used in our documentation) and also means that a user cannot define their own {{CombineFn}} unless they put them in the {{transform}} package.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)