text:
Latest Sovereign debt News
New Greek PM calls bond auction "vote of confidence"
Jul. 16, 2019 2:46 PM EDT
ATHENS, Greece (AP) — Greece launched a 7-year bond auction Tuesday, the country's third effort this year to raise money from international markets while improved borrowing rates provide an advantage. The auction aimed at raising 2.5 billion euros ($2.8 billion) followed 5-year and 10-year bond issues...
___ Report: FTC approves roughly $5B fine for Facebook SAN FRANCISCO (AP) — A Wall Street Journal report says that the FTC has voted this week to approve a fine of about $5 billion for Facebook over privacy violations. The report Friday cites an unnamed person familiar with the matter. Facebook and the FTC...
Mnuchin urges Congress to quickly pass new debt limit
WASHINGTON (AP) — Treasury Secretary Steven Mnuchin told congressional leaders that the debt ceiling should be raised before lawmakers leave for their August recess to avert the potential of an unprecedented default on the national debt. In a letter to House and Senate leaders Friday, Mnuchin said that...
US budget deficit jumps 23% through June
WASHINGTON (AP) — The U.S. budget deficit increased by $140 billion during the first nine months of this budget year to $747.1 billion as government revenues and spending both hit records. The Treasury Department reported Thursday that the deficit for the current fiscal year through June is up 23.1% over...
Jul. 9, 2019 5:51 PM EDT
DALLAS (AP) — H. Ross Perot rose from a childhood of Depression-era poverty to become a self-made billionaire who twice ran for president with a mixture of folksy sayings and simple solutions to America's problems. His 19% of the vote in 1992 stands among the best showings by an independent candidate in...
Greece creditors say no changes in bailout terms for new PM
ATHENS, Greece (AP) — Greece's bailout creditors on Monday bluntly rejected calls from the country's new conservative government to ease draconian budget conditions agreed as part of its rescue program. Conservative party leader Kyriakos Mitsotakis was sworn in as Greece's new prime minister Monday, a day...
White House offers budget freeze if Dems don't agree to deal
Jun. 19, 2019 8:38 PM EDT
WASHINGTON (AP) — Trump administration bargainers offered a one-year budget freeze and said Democratic spending demands remained too high as talks with congressional leaders aimed at averting deep cuts in defense and domestic programs seemed no closer to resolution Wednesday. After White House Chief of...
May budget deficit hits record $207.8 billion
WASHINGTON (AP) — The federal government's budget deficit in May rose to a record $207.8 billion, 41.5% higher than a year ago. Most of that increase reflected the impact of calendar quirks that shifted $55 billion in June benefit payments into May. The Treasury Department said Wednesday that the increase...
Catfish, rice, Navy ships: Cochran spending leaves legacy
Jun. 1, 2019 11:22 AM EDT
JACKSON, Miss. (AP) — Former U.S. Sen. Thad Cochran was a master of the federal budget process, quietly shrugging off criticism about pork-barrel spending while directing billions of dollars back to his home state of Mississippi. Cochran died Thursday at age 81. He was the 10th longest-serving senator in...
Lebanese Cabinet agrees on 2019 austerity budget
May. 24, 2019 1:15 PM EDT
BEIRUT (AP) — Lebanese Cabinet ministers wrapped up weeks of haggling, agreeing on a 2019 draft budget that aims to avert a financial crisis by cutting public spending and reduce a ballooning deficit. Critics say the proposed measures fail to introduce structural reforms needed to rescue the flagging...
LOADING MORE STORIES
©2019 The Associated Press. All rights reserved.
Terms under which this site is provided. Learn more about our Privacy Policy.


text:
Revisiting Compassion and Conservatism
This is the week, four years ago, when we were finally introduced to George W. Bush. The Republican convention of 2000 was his coming out party, as are most conventions these days. He seemed personable, down to earth, strong, a guy who could appreciate a little horseplay. He certainly seemed more lively than Al Gore, though the intelligence gap between them, even then, was clearly a chasm.
I'd vote for Gore on his record and his intelligence, his grasp of the issues, his experience in the upper echelons of power. But I didn't think any less of Bush than I think of most children of privilege - a little sheltered from the real world, a measure of naievete borne in the protection of wealth, perhaps a bit frightened by their own sweat. In fact, I found his message of compassionate conservatism intruguing and a worthy ideal to which to aspire.
Four years later, it's time to reassess.
In the midst of the Republican convention of 2004, I find myself wondering aloud what happened to that ideal. A man who has spent nearly a hundred million dollars on advertising that accomplishes little more than to paint his opponent as a "flip-flopper" should be clear and consistent on every issue, shouldn't he? Wouldn't we view an adulterous minister, railing to his congregation on the evils of the flesh, as a hypocrite? If a man preaches compassion, shouldn't he truly be compassionate? If he speaks in lowered and respectful tones about the virtues of conservatism, shouldn't he actually be conservative? Personally, I wonder about a man's view of those around him when he talks the talk but refuses to walk the walk. Does he think we're just not watching?
A truly compassionate president would be driven unerringly to assure that those with the least are properly looked after. The poor would be given the hand they need, the hand they desperately crave, to pull themselves from poverty, and only for as long as it took to make that happen. That's all they want. The sick and infirm would be given every assurance that the vast wealth of the United States is behind the research that will ease their pain and prevent it in their grandchildren. That's their respite. Those on the edges of society would sleep well at night knowing that their lives and lifestyles were meaningful to the overall fabric of society. That recognition is their greatest aspiration.
The Gap Widens
In each of the past four years, the number of American citizens living in poverty has increased. Those in the top ten percent of income have gotten disproportionately wealthier.
Americans Back Stem Cell Research Funds
Is there any public entity engaged in sussing out the ethical questions surrounding stem cell research? These questions are, after all, the reason for the limitation on research that could change the life of everyone in America. Are we really looking for the answers?
GOP platform seeks gay marriage ban
For the first time in American history, a president has gone on record in support of a constitutional amendment that will ban an entire class of American citizens from the full and equal protection of the law.
Regardless of what you may hear from New York this week, this isn't compassion. It's cruelty, plain and simple.
I was raised in a conservative Republican household. Long before I even knew what a liberal was, I had a solid grasp of the core principles of the Republican party and conservatism. Remember the convention many now refer to as the "last with any meaning," the 1976 Republican convention in Kansas City? I was in Kemper Arena when Ronald Reagan and George Bush stood on the stage with Gerald Ford, nominated by his party less than a day before. Conservatism, as I was taught, was about spending less than you bring in. In time and with diligence, that could lead to a tax cut. Conservatism was about making the Federal government smaller and less intrusive. This while still providing the states with funding and services that would keep them strong - truly a republic. Conservatism was about prudence on the world stage and strength in diplomacy. To win hearts and minds with the fruits of our wealth but to always, always protect us from the real enemies.
Federal budget deficit hits record $395.8 billion
How can we possibly spend so much more than we take in? To paraphrase a well-known quote, by "spending like a drunken Guardsman."
Rules of court limit who can challenge Patriot Act provision
Only those old enough to remember the McCarthy era have ever seen the government so deeply in our business.
Republicans Again Link Iraq War to War on Terror
There must be a connection because they keep telling us so.
This clearly isn't conservatism. It's an utter and absolute lack of both fiscal and moral responsibility.
I'm not sure how much if at all we'll hear the phrase "compassionate conservatism" over the course of the next few nights, though it was the rallying cry just four years ago. I'm sure we will, however, hear the phrase "flip-flop" ad nauseum. If that phrase means "to deviate from one's stated position," well, then it's really all just a matter of perspective, now, isn't it?
Posted by Tony Steidler-Dennison at August 31, 2004 11:58 PM

redpajama_set_name: RedPajamaCommonCrawl


Complete your bedding set with this fabulous supersoft Pillowcase from Silentnight.
Chambray effect melange jersey bed linen is incredibly soft, providing a restful night's sleep.
Browse more Pillowcases online, and buy in-store at B&M.


text:
You are here: Home / Local Regional News / Moments in Memory
Moments in Memory
The exact day the local newspaper in Chattanooga started is unknown, but the year was 1869. What is known is that The Daily Times was published on Dec. 30, 1869, and a newspaper has been a part of the Chattanooga community for all the 54,435 days since. A second daily newspaper began publishing in Chattanooga in 1891 and continued until 1999, when the two merged to form this newspaper. Inside all those pages of newsprint over the last 149 years can be found the ultimate textbook on Chattanooga history, with tens of thousands of chapters. "Historically, newspapers have played a unique role in this country's history," said Penny Abernathy, who holds the Knight Chair in Journalism and Digital Media Economics at the University of North Carolina. "Newspapers have been community builders as well as educators of its citizens. The first thing a founder of a community west of the Mississippi would do is to put out a newspaper because it creates a sense of identity." Abernathy is a former editor at the Wall Street Journal and The New York Times, where she learned about the history of Adolph Ochs, who bought The Daily Times in 1878 and later bought The New York Times. Abernathy said few communities in America have the legacy of journalism that exists in the Chattanooga region. "The people who owned newspapers in Chattanooga understood that journalism is not just a way to make money, but a calling," Abernathy said. "It is a mission-driven enterprise where the… [Read full story]
Facebook's New "Memories" Page Highlights Engaging Posts from Years Past
Britons share touching memories of Apollo 11 moon landing
Remembering a special moment
Pink Defends Picture of Her Kids Running in Holocaust Memorial
Henning: 45 years covering sports provide endless memories
VIP view: Rockets players team up with Children's Memorial Hermann MVPs at Toyota Center
'They create lifelong memories'
Solemn air on campus ahead of memorials for shooting victims
Memorial held for 5 slain Capital Gazette employees
Comic-Con founders reflect on 50 years of memories
Local Regional News Chattanooga News, Chattanooga Newspaper, Chattanooga, Tennessee, Georgia, Alabama, Chattanooga Times Free Press, Chattanooga Breaking News, Breaking News Updates, Top Stories, Local Regional, Chattanooga Sports, Chattanooga local Sports, Chattanooga Preps, Chattanooga Life, Chattanooga Business, Chattanooga local Business, National, International, Chattanooga local news, Chattanooga movies, Chattanooga music, Chattanooga entertainment, Chattanooga arts, Chattanooga concerts, entertainment news, tickets, neighborhoods, Local Regional News


text:
4110 Open-access theses in TDX
Totes les tesis
Privacy protection of user profiles in personalized information systems
TJP1de1.pdf (6,389Mb)
Parra Arnau, Javier
Tutor / director / evaluatorForné Muñoz, Jorge ; Rebollo Monedero, David
Chair / Department / Institute
Universitat Politècnica de Catalunya. Departament d'Enginyeria Telemàtica
Document typeDoctoral thesis
Defense date2013-12-02
PublisherUniversitat Politècnica de Catalunya
In recent times we are witnessing the emergence of a wide variety of information systems that tailor the information-exchange functionality to meet the specific interests of their users. Most of these personalized information systems capitalize on, or lend themselves to, the construction of profiles, either directly declared by a user, or inferred from past activity. The ability of these systems to profile users is therefore what enables such intelligent functionality, but at the same time, it is the source of serious privacy concerns. Although there exists a broad range of privacy-enhancing technologies aimed to mitigate many of those concerns, the fact is that their use is far from being widespread. The main reason is that there is a certain ambiguity about these technologies and their effectiveness in terms of privacy protection. Besides, since these technologies normally come at the expense of system functionality and utility, it is challenging to assess whether the gain in privacy compensates for the costs in utility. Assessing the privacy provided by a privacy-enhancing technology is thus crucial to determine its overall benefit, to compare its effectiveness with other technologies, and ultimately to optimize it in terms of the privacy-utility trade-off posed. Considerable effort has consequently been devoted to investigating both privacy and utility metrics. However, most of these metrics are specific to concrete systems and adversary models, and hence are difficult to generalize or translate to other contexts. Moreover, in applications involving user profiles, there are a few proposals for the evaluation of privacy, and those existing are not appropriately justified or fail to justify the choice. The first part of this thesis approaches the fundamental problem of quantifying user privacy. Firstly, we present a theoretical framework for privacy-preserving systems, endowed with a unifying view of privacy in terms of the estimation error incurred by an attacker who aims to disclose the private information that the system is designed to conceal. Our theoretical analysis shows that numerous privacy metrics emerging from a broad spectrum of applications are bijectively related to this estimation error, which permits interpreting and comparing these metrics under a common perspective. Secondly, we tackle the issue of measuring privacy in the enthralling application of personalized information systems. Specifically, we propose two information-theoretic quantities as measures of the privacy of user profiles, and justify these metrics by building on Jaynes' rationale behind entropy-maximization methods and fundamental results from the method of types and hypothesis testing. Equipped with quantifiable measures of privacy and utility, the second part of this thesis investigates privacy-enhancing, data-perturbative mechanisms and architectures for two important classes of personalized information systems. In particular, we study the elimination of tags in semantic-Web applications, and the combination of the forgery and the suppression of ratings in personalized recommendation systems. We design such mechanisms to achieve the optimal privacy-utility trade-off, in the sense of maximizing privacy for a desired utility, or vice versa. We proceed in a systematic fashion by drawing upon the methodology of multiobjective optimization. Our theoretical analysis finds a closed-form solution to the problem of optimal tag suppression, and to the problem of optimal forgery and suppression of ratings. In addition, we provide an extensive theoretical characterization of the trade-off between the contrasting aspects of privacy and utility. Experimental results in real-world applications show the effectiveness of our mechanisms in terms of privacy protection, system functionality and data utility.
CitationParra Arnau, J. "Privacy protection of user profiles in personalized information systems". Tesi doctoral, UPC, Departament d'Enginyeria Telemàtica, 2013. Available at: <http://hdl.handle.net/2117/95312>
DLB 16022-2014
Tesis - Departament d'Enginyeria Telemàtica [76]
Tesis - Totes les tesis [4110]
TJP1de1.pdf 6,389Mb PDF View/Open


text:
Minister for Agriculture and Food (Western Australia)
(Redirected from Minister for Agriculture (Western Australia))
The Minister for Agriculture and Food is a position in the Cabinet of Western Australia. The minister is responsible for the Department of Agriculture and Food, and usually holds several other portfolios.
Minister for Agriculture and Food
Alannah MacTiernan MLC
since 17 March 2017 (2017-03-17)
Department of Agriculture and Food
The Honourable
Nominator
Premier of Western Australia
Appointer
Governor of Western Australia
Inaugural holder
John Drew MLC
(as Minister for Agriculture)
7 June 1905 (1905-06-07)
Minister Alannah MacTiernan MLC
The responsibilities now incorporated in the portfolio were originally held by the Colonial Secretary, and it was not until the 1904 Daglish Ministry that a separate Minister for Agriculture was appointed, with the inaugural minister being the nominally independent John Drew. From its first implementation through to the 1920s, and sporadically afterward, the titles of Minister for Agriculture and Minister for Lands were generally held by the same person, although the positions were legally separate, and were quite different in scope. A similar situation has existed since the late 1970s with the Fisheries and Forests portfolios. The minister's title was simply "Minister for Agriculture" until 1993, when Monty House was made Minister for Primary Industries in the Court–Cowan Ministry. The current title was implemented in 2005.
The current Minister for Agriculture and Food is Alannah MacTiernan of the Labor Party. The previous Minister for Agriculture and Food was Mark Lewis of the Liberal Party. Lewis was only the third Liberal to hold the position – in previous Coalition governments, the position has been reserved for members of the National Party (and its predecessors).[1][2]
List of Ministers for Agriculture and FoodEdit
Thirty three people have been appointed as Minister for Agriculture and Food (or equivalent) in Western Australia, with Crawford Nalder's 11 years and 335 days the longest time period in the position.[3] In the table below, members of the Legislative Council are designated "MLC". All others were members of the Legislative Assembly at the time of their service. In Western Australia, serving ministers are entitled to be styled "The Honourable", and may retain the style after three years' service in the ministry.[4]
Term in office
1 John Drew MLC Independent Daglish Minister for Agriculture 7 June 1905 (1905-06-07) 25 August 1905 (1905-08-25) 79 days
2 Newton Moore Ministerialist Rason 25 August 1905 (1905-08-25) 7 May 1906 (1906-05-07) 255 days
3 Frank Wilson Moore 7 May 1906 (1906-05-07) 30 June 1909 (1909-06-30) 3 years, 54 days
4 James Mitchell 30 June 1909 (1909-06-30) 16 September 1910 (1910-09-16) 2 years, 99 days
Liberal Wilson 16 September 1910 (1910-09-16) 7 October 1911 (1911-10-07)
5 Thomas Bath Labor Scaddan 7 October 1911 (1911-10-07) 23 November 1914 (1914-11-23) 3 years, 47 days
6 William Johnson 23 November 1914 (1914-11-23) 27 July 1916 (1916-07-27) 1 year, 247 days
7 Sir Henry Lefroy KCMG Liberal Wilson 27 July 1916 (1916-07-27) 28 July 1917 (1917-07-28) 2 years, 264 days
Nationalist Lefroy 28 July 1917 (1917-07-28) 17 April 1919 (1919-04-17)
8 Charles Baxter MLC Country Colebatch 17 April 1919 (1919-04-17) 17 May 1919 (1919-05-17) 30 days
9 Hal Colebatch MLC Nationalist Mitchell 17 May 1919 (1919-05-17) 3 April 1921 (1921-04-03) 1 year, 351 days
10 Henry Kennedy Maley Country 3 April 1921 (1921-04-03) 15 April 1924 (1924-04-15) 3 years, 12 days
11 Michael Troy Labor Collier 15 April 1924 (1924-04-15) 15 December 1927 (1927-12-15) 3 years, 244 days
12 Harry Millington 15 December 1927 (1927-12-15) 23 April 1930 (1930-04-23) 2 years, 129 days
13 Percy Ferguson Country Mitchell 23 April 1930 (1930-04-23) 24 April 1933 (1933-04-24) 3 years, 1 day
(12) Harry Millington Labor Collier 24 April 1933 (1933-04-24) 26 March 1935 (1935-03-26) 1 year, 336 days
14 Frank Wise 26 March 1935 (1935-03-26) 19 August 1936 (1936-08-19) 10 years, 130 days
Willcock 19 August 1936 (1936-08-19) 31 July 1945 (1945-07-31)
Wise 31 July 1945 (1945-07-31) 3 August 1945 (1945-08-03)
15 John Tonkin 3 August 1945 (1945-08-03) 1 April 1947 (1947-04-01) 1 year, 241 days
16 Lindsay Thorn Country McLarty 1 April 1947 (1947-04-01) 5 January 1948 (1948-01-05) 279 days
17 Garnet Wood MLC Honorary Minister for Agriculture 5 January 1948 (1948-01-05) 24 October 1950 (1950-10-24) 3 years, 363 days
Minister for Agriculture 24 October 1950 (1950-10-24) 3 January 1952 (1952-01-03)
18 Sir Charles Latham MLC 3 January 1952 (1952-01-03) 23 February 1953 (1953-02-23) 1 year, 79 days
19 Ernest Hoar Labor Hawke 23 February 1953 (1953-02-23) 17 December 1957 (1957-12-17) 4 years, 297 days
20 Lionel Kelly 17 December 1957 (1957-12-17) 2 April 1959 (1959-04-02) 1 year, 106 days
21 Crawford Nalder Country Brand 2 April 1959 (1959-04-02) 3 March 1971 (1971-03-03) 11 years, 335 days
22 David Evans Labor Tonkin 3 March 1971 (1971-03-03) 8 April 1974 (1974-04-08) 3 years, 36 days
23 Ray McPharlin National Alliance Court 8 April 1974 (1974-04-08) 20 May 1975 (1975-05-20) 1 year, 42 days
24 Dick Old National Country 5 June 1975 (1975-06-05) 25 January 1982 (1982-01-25) 7 years, 263 days
O'Connor 25 January 1982 (1982-01-25) 23 February 1983 (1983-02-23)
(22) David Evans Labor Burke 23 February 1983 (1983-02-23) 26 February 1986 (1986-02-26) 3 years, 3 days
25 Julian Grill 26 February 1986 (1986-02-26) 25 February 1988 (1988-02-25) 3 years, 2 days
Dowding 25 February 1988 (1988-02-25) 28 February 1989 (1989-02-28)
26 Ernie Bridge 28 February 1989 (1989-02-28) 12 February 1990 (1990-02-12) 3 years, 354 days
Lawrence 12 February 1990 (1990-02-12) 16 February 1993 (1993-02-16)
27 Monty House National Court Minister for Primary Industries 16 February 1993 (1993-02-16) 16 February 2001 (2001-02-16) 8 years, 0 days
28 Kim Chance Labor Gallop Minister for Agriculture 16 February 2001 (2001-02-16) 1 July 2001 (2001-07-01) 7 years, 220 days
Minister for Agriculture, Forestry, and Fisheries 1 July 2001 (2001-07-01) 10 March 2005 (2005-03-10)
Minister for Agriculture and Forestry 10 March 2005 (2005-03-10) 25 January 2006 (2006-01-25)
Carpenter 25 January 2006 (2006-01-25) 3 February 2006 (2006-02-03)
Minister for Agriculture and Food 3 February 2006 (2006-02-03) 23 September 2008 (2008-09-23)
29 Terry Redman National Barnett 23 September 2008 (2008-09-23) 21 March 2013 (2013-03-21) 4 years, 179 days
30 Ken Baston MLC Liberal 21 March 2013 (2013-03-21) 31 March 2016 (2016-03-31) 3 years, 10 days
31 Dean Nalder 31 March 2016 (2016-03-31) 20 September 2016 (2016-09-20) 173 days
32 Mark Lewis 22 September 2016 (2016-09-22) 17 March 2017 (2017-03-17) 4 years, 116 days
33 Alannah MacTiernan MLC Labor McGowan 17 March 2017 (2017-03-17) incumbent 3 years, 305 days
^ Cattle, Tyson (30 March 2013). "New Ag Minister to hit the ground running". Farm Weekly. Retrieved 1 October 2013.
^ Thompson, Brad (17 May 2013). "Grylls defends farm policy". The West Australian. Retrieved 1 October 2013.
^ Agriculture Ministers of Western Australia – Parliamentary Library of Western Australia. Last updated 29 June 2012. Retrieved 1 October 2013.
^ Addressing a Member of Parliament – Parliament of Western Australia. Retrieved 1 October 2013.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Minister_for_Agriculture_and_Food_(Western_Australia)&oldid=996724761"


text:
package org.apache.spark.shuffle.sort;

import java.util.Comparator;

import org.apache.spark.memory.MemoryConsumer;
import org.apache.spark.unsafe.Platform;
import org.apache.spark.unsafe.array.LongArray;
import org.apache.spark.unsafe.memory.MemoryBlock;
import org.apache.spark.util.collection.Sorter;
import org.apache.spark.util.collection.unsafe.sort.RadixSort;

final class ShuffleInMemorySorter {

  private static final class SortComparator implements Comparator<PackedRecordPointer> {
    @Override
    public int compare(PackedRecordPointer left, PackedRecordPointer right) {
      return Integer.compare(left.getPartitionId(), right.getPartitionId());
    }
  }
  private static final SortComparator SORT_COMPARATOR = new SortComparator();

  private final MemoryConsumer consumer;

  /**
   * An array of record pointers and partition ids that have been encoded by
   * {@link PackedRecordPointer}. The sort operates on this array instead of directly manipulating
   * records.
   *
   * Only part of the array will be used to store the pointers, the rest part is preserved as
   * temporary buffer for sorting.
   */
  private LongArray array;

  /**
   * Whether to use radix sort for sorting in-memory partition ids. Radix sort is much faster
   * but requires additional memory to be reserved memory as pointers are added.
   */
  private final boolean useRadixSort;

  /**
   * The position in the pointer array where new records can be inserted.
   */
  private int pos = 0;

  /**
   * How many records could be inserted, because part of the array should be left for sorting.
   */
  private int usableCapacity = 0;

  private final int initialSize;

  ShuffleInMemorySorter(MemoryConsumer consumer, int initialSize, boolean useRadixSort) {
    this.consumer = consumer;
    assert (initialSize > 0);
    this.initialSize = initialSize;
    this.useRadixSort = useRadixSort;
    this.array = consumer.allocateArray(initialSize);
    this.usableCapacity = getUsableCapacity();
  }

  private int getUsableCapacity() {
    // Radix sort requires same amount of used memory as buffer, Tim sort requires
    // half of the used memory as buffer.
    return (int) (array.size() / (useRadixSort ? 2 : 1.5));
  }

  public void free() {
    if (array != null) {
      consumer.freeArray(array);
      array = null;
    }
  }

  public int numRecords() {
    return pos;
  }

  public void reset() {
    // Reset `pos` here so that `spill` triggered by the below `allocateArray` will be no-op.
    pos = 0;
    if (consumer != null) {
      consumer.freeArray(array);
      // As `array` has been released, we should set it to  `null` to avoid accessing it before
      // `allocateArray` returns. `usableCapacity` is also set to `0` to avoid any codes writing
      // data to `ShuffleInMemorySorter` when `array` is `null` (e.g., in
      // ShuffleExternalSorter.growPointerArrayIfNecessary, we may try to access
      // `ShuffleInMemorySorter` when `allocateArray` throws SparkOutOfMemoryError).
      array = null;
      usableCapacity = 0;
      array = consumer.allocateArray(initialSize);
      usableCapacity = getUsableCapacity();
    }
  }

  public void expandPointerArray(LongArray newArray) {
    assert(newArray.size() > array.size());
    Platform.copyMemory(
      array.getBaseObject(),
      array.getBaseOffset(),
      newArray.getBaseObject(),
      newArray.getBaseOffset(),
      pos * 8L
    );
    consumer.freeArray(array);
    array = newArray;
    usableCapacity = getUsableCapacity();
  }

  public boolean hasSpaceForAnotherRecord() {
    return pos < usableCapacity;
  }

  public long getMemoryUsage() {
    return array.size() * 8;
  }

  /**
   * Inserts a record to be sorted.
   *
   * @param recordPointer a pointer to the record, encoded by the task memory manager. Due to
   *                      certain pointer compression techniques used by the sorter, the sort can
   *                      only operate on pointers that point to locations in the first
   *                      {@link PackedRecordPointer#MAXIMUM_PAGE_SIZE_BYTES} bytes of a data page.
   * @param partitionId the partition id, which must be less than or equal to
   *                    {@link PackedRecordPointer#MAXIMUM_PARTITION_ID}.
   */
  public void insertRecord(long recordPointer, int partitionId) {
    if (!hasSpaceForAnotherRecord()) {
      throw new IllegalStateException("There is no space for new record");
    }
    array.set(pos, PackedRecordPointer.packPointer(recordPointer, partitionId));
    pos++;
  }

  /**
   * An iterator-like class that's used instead of Java's Iterator in order to facilitate inlining.
   */
  public static final class ShuffleSorterIterator {

    private final LongArray pointerArray;
    private final int limit;
    final PackedRecordPointer packedRecordPointer = new PackedRecordPointer();
    private int position = 0;

    ShuffleSorterIterator(int numRecords, LongArray pointerArray, int startingPosition) {
      this.limit = numRecords + startingPosition;
      this.pointerArray = pointerArray;
      this.position = startingPosition;
    }

    public boolean hasNext() {
      return position < limit;
    }

    public void loadNext() {
      packedRecordPointer.set(pointerArray.get(position));
      position++;
    }
  }

  /**
   * Return an iterator over record pointers in sorted order.
   */
  public ShuffleSorterIterator getSortedIterator() {
    int offset = 0;
    if (useRadixSort) {
      offset = RadixSort.sort(
        array, pos,
        PackedRecordPointer.PARTITION_ID_START_BYTE_INDEX,
        PackedRecordPointer.PARTITION_ID_END_BYTE_INDEX, false, false);
    } else {
      MemoryBlock unused = new MemoryBlock(
        array.getBaseObject(),
        array.getBaseOffset() + pos * 8L,
        (array.size() - pos) * 8L);
      LongArray buffer = new LongArray(unused);
      Sorter<PackedRecordPointer, LongArray> sorter =
        new Sorter<>(new ShuffleSortDataFormat(buffer));

      sorter.sort(array, 0, pos, SORT_COMPARATOR);
    }
    return new ShuffleSorterIterator(pos, array, offset);
  }
}

redpajama_set_name: RedPajamaGithub