Thorlib.ecl 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*##############################################################################
  2. ## HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®. All rights reserved.
  3. ############################################################################## */
  4. /*
  5. * Internal functions for accessing system information relating to execution on the thor engine.
  6. *
  7. * This module is currently treated as internal, and subject to change without notice.
  8. */
  9. externals :=
  10. SERVICE
  11. unsigned integer4 node() : ctxmethod, entrypoint='getNodeNum';
  12. unsigned integer4 nodes() : ctxmethod, entrypoint='getNodes';
  13. varstring l2p(const varstring name, boolean create=false) : ctxmethod, entrypoint='getFilePart';
  14. unsigned integer getFileOffset(const varstring lfname) : ctxmethod, entrypoint='getFileOffset';
  15. varstring daliServer() : once, ctxmethod, entrypoint='getDaliServers';
  16. varstring cluster() : once, ctxmethod, entrypoint='getClusterName';
  17. varstring getExpandLogicalName(const varstring name) : pure, ctxmethod, entrypoint='getExpandLogicalName';
  18. varstring group() : once, ctxmethod, entrypoint='getGroupName';
  19. varstring platform() : pure ,ctxmethod, entrypoint='getPlatform';
  20. END;
  21. RETURN MODULE
  22. /*
  23. * Returns the index of the slave node this piece of code is executing on. Zero based.
  24. */
  25. export node() := externals.node();
  26. /*
  27. * Converts a logical filename to a physical filename.
  28. *
  29. * @param name The logical filename to be converted.
  30. * @param create True if creating a new file, false if reading an existing file.
  31. */
  32. export logicalToPhysical(const varstring name, boolean create=false) := externals.l2p(name, create);
  33. /*
  34. * How many nodes in the cluster that this code will be executed on.
  35. */
  36. export nodes() := CLUSTERSIZE;
  37. /*
  38. * Returns the dali server this thor is connected to.
  39. */
  40. export daliServer() := externals.daliServer();
  41. /*
  42. * Returns which thor group the job is currently executing on.
  43. */
  44. export group() := externals.group();
  45. /*
  46. * Converts a logical filename to a physical filename.
  47. */
  48. export getExpandLogicalName(const varstring name) := externals.getExpandLogicalName(name);
  49. /*
  50. * Returns the name of the cluster the query is currently executing on.
  51. */
  52. export cluster() := externals.cluster();
  53. /*
  54. * Returns the platform the query is currently executing on.
  55. */
  56. export platform() := externals.platform();
  57. /*
  58. * The following are either unused, or should be replaced with a different syntax.
  59. export getenv(const varstring name, const varstring defaultValue) := externals.getenv(name, defaultValue);
  60. - use getenv() built in command instead.
  61. export getFileOffset(const varstring lfname) := externals.getFileOffset(lfname);
  62. */
  63. END;